Class ServiceInvocationHandler
java.lang.Object
jadex.providedservice.impl.service.AbstractServiceInvocationHandler
jadex.providedservice.impl.service.ServiceInvocationHandler
- All Implemented Interfaces:
ISwitchCall
,InvocationHandler
public class ServiceInvocationHandler
extends AbstractServiceInvocationHandler
implements InvocationHandler, ISwitchCall
Service invocation interceptor.
It has a multi collection of interceptors per method.
Executes the list of interceptors one by one.
In case no handler can be found a fallback handler is used.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jadex.core.impl.Component
The internal access.static final String
The (default) decoupled proxy type (decouples from caller thread to component thread).static final String
The direct proxy type (supports custom interceptors, but uses caller thread).static final String
The raw proxy type (i.e.protected boolean
The flag if the proxy is required (provided otherwise).protected Object
The service.protected IServiceIdentifier
The service identifier.protected boolean
The flag if a switchcall should be done.Fields inherited from class jadex.providedservice.impl.service.AbstractServiceInvocationHandler
interceptors
-
Constructor Summary
ConstructorsConstructorDescriptionServiceInvocationHandler
(jadex.core.impl.Component comp, ServiceInfo service) Create a new invocation handler.ServiceInvocationHandler
(jadex.core.impl.Component comp, IServiceIdentifier sid, boolean required) Create a new invocation handler.ServiceInvocationHandler
(jadex.core.impl.Component comp, IService service, boolean required) Create a new invocation handler. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test if two objects are equal.Get the domain service.Get the service.Get the sid.int
hashCode()
Return the hash code.A proxy method has been invoked.boolean
Check if the handler is for a required service proxy.boolean
Check if a switch call should be done.toString()
Get a string representation.Methods inherited from class jadex.providedservice.impl.service.AbstractServiceInvocationHandler
addFirstServiceInterceptor, addServiceInterceptor, addServiceInterceptor, getInterceptors, removeServiceInterceptor
-
Field Details
-
PROXYTYPE_RAW
The raw proxy type (i.e. no proxy).- See Also:
-
PROXYTYPE_DIRECT
The direct proxy type (supports custom interceptors, but uses caller thread).- See Also:
-
PROXYTYPE_DECOUPLED
The (default) decoupled proxy type (decouples from caller thread to component thread).- See Also:
-
comp
protected jadex.core.impl.Component compThe internal access. -
sid
The service identifier. -
service
The service. -
required
protected boolean requiredThe flag if the proxy is required (provided otherwise). -
switchcall
protected boolean switchcallThe flag if a switchcall should be done.
-
-
Constructor Details
-
ServiceInvocationHandler
public ServiceInvocationHandler(jadex.core.impl.Component comp, IServiceIdentifier sid, boolean required) Create a new invocation handler. -
ServiceInvocationHandler
Create a new invocation handler. -
ServiceInvocationHandler
Create a new invocation handler.
-
-
Method Details
-
invoke
A proxy method has been invoked.- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
getServiceIdentifier
Get the sid.- Returns:
- the sid.
-
getService
Get the service.- Specified by:
getService
in classAbstractServiceInvocationHandler
- Returns:
- The service.
-
getDomainService
Get the domain service.- Specified by:
getDomainService
in classAbstractServiceInvocationHandler
- Returns:
- The domain service.
-
hashCode
public int hashCode()Return the hash code. -
equals
Test if two objects are equal. -
toString
Get a string representation. -
isSwitchCall
public boolean isSwitchCall()Check if a switch call should be done.- Specified by:
isSwitchCall
in interfaceISwitchCall
- Returns:
- True, if switch should be done.
-
isRequired
public boolean isRequired()Check if the handler is for a required service proxy.- Specified by:
isRequired
in classAbstractServiceInvocationHandler
-