public final class MethodHandler
extends java.lang.Object
Service
method specification and tests at each step if the
calling sequence is allowed. This is the main class for controlling the traversal
through the nested services and also checks if the specified method exists and can be
legally called with the specified passwords. The comparison check tests for the method name,
return type and also all of the input parameter types. If the call is to a remote object,
then this class will construct the remote calling object and try to make the remote call
automatically as well.Constructor and Description |
---|
MethodHandler(java.lang.String thisTempPassword,
Service thisParent)
Creates a new instance of MethodHandler.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
execute(MethodInfo methodInfo)
Execute a call using the invoke method of Java
Reflection . |
boolean |
reRoute(MethodInfo methodInfo)
Parse the method info to determine the next path stage and return the next method call.
|
public MethodHandler(java.lang.String thisTempPassword, Service thisParent)
thisTempPassword
- a temporary password.thisParent
- the parent service that the service to invoke is retrieved
from. This can get traversed through a path description, from the server
to the final parent service, but the final password is always required.public final boolean reRoute(MethodInfo methodInfo) throws java.lang.Exception
methodInfo
- the method call description with all of the required information.java.lang.Exception
- any error.public final java.lang.Object execute(MethodInfo methodInfo) throws ServiceException, ServiceNotFoundException, PasswordException, java.lang.Exception
Reflection
.methodInfo
- the method call description with all of the required information.ServiceException
- access to the service is not allowed.ServiceNotFoundException
- the service has not been found.PasswordException
- password is not correct.java.lang.Exception
- any other error.