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.ComponentThe internal access.static final StringThe (default) decoupled proxy type (decouples from caller thread to component thread).static final StringThe direct proxy type (supports custom interceptors, but uses caller thread).static final StringThe raw proxy type (i.e.protected booleanThe flag if the proxy is required (provided otherwise).protected ObjectThe service.protected IServiceIdentifierThe service identifier.protected booleanThe 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 TypeMethodDescriptionbooleanTest if two objects are equal.Get the domain service.Get the service.Get the sid.inthashCode()Return the hash code.A proxy method has been invoked.booleanCheck if the handler is for a required service proxy.booleanCheck 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:
invokein interfaceInvocationHandler- Throws:
Throwable
-
getServiceIdentifier
Get the sid.- Returns:
- the sid.
-
getService
Get the service.- Specified by:
getServicein classAbstractServiceInvocationHandler- Returns:
- The service.
-
getDomainService
Get the domain service.- Specified by:
getDomainServicein 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:
isSwitchCallin interfaceISwitchCall- Returns:
- True, if switch should be done.
-
isRequired
public boolean isRequired()Check if the handler is for a required service proxy.- Specified by:
isRequiredin classAbstractServiceInvocationHandler
-