Package jadex.bridge.service.component
Class RemoteMethodInvocationHandler
- java.lang.Object
-
- jadex.bridge.service.component.RemoteMethodInvocationHandler
-
- All Implemented Interfaces:
ISwitchCall
,java.lang.reflect.InvocationHandler
public class RemoteMethodInvocationHandler extends java.lang.Object implements java.lang.reflect.InvocationHandler, ISwitchCall
Class that implements the Java proxy InvocationHandler, which is called when a method on a proxy is called.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
comp
The local component.protected jadex.bridge.component.impl.remotecommands.ProxyReference
pr
The proxy reference.
-
Constructor Summary
Constructors Constructor Description RemoteMethodInvocationHandler(IInternalAccess comp, jadex.bridge.component.impl.remotecommands.ProxyReference pr)
Create a new invocation handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IService
createRemoteServiceProxy(IInternalAccess localcomp, IServiceIdentifier remotesvc)
Create a proxy object for a remote service.boolean
equals(java.lang.Object obj)
Test equality.jadex.bridge.component.impl.remotecommands.ProxyReference
getProxyReference()
Get the pr.int
hashCode()
Hash code.java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
Invoke a method.boolean
isSwitchCall()
Check if a switch call should be done.
-
-
-
Field Detail
-
comp
protected IInternalAccess comp
The local component.
-
pr
protected jadex.bridge.component.impl.remotecommands.ProxyReference pr
The proxy reference.
-
-
Constructor Detail
-
RemoteMethodInvocationHandler
public RemoteMethodInvocationHandler(IInternalAccess comp, jadex.bridge.component.impl.remotecommands.ProxyReference pr)
Create a new invocation handler.
-
-
Method Detail
-
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
Invoke a method.- Specified by:
invoke
in interfacejava.lang.reflect.InvocationHandler
- Throws:
java.lang.Throwable
-
getProxyReference
public jadex.bridge.component.impl.remotecommands.ProxyReference getProxyReference()
Get the pr.- Returns:
- the pr.
-
isSwitchCall
public boolean isSwitchCall()
Check if a switch call should be done.- Specified by:
isSwitchCall
in interfaceISwitchCall
- Returns:
- True, if switch should be done.
-
equals
public boolean equals(java.lang.Object obj)
Test equality.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCode
in classjava.lang.Object
-
createRemoteServiceProxy
public static IService createRemoteServiceProxy(IInternalAccess localcomp, IServiceIdentifier remotesvc)
Create a proxy object for a remote service.- Parameters:
localcomp
- The local component for sending/receiving messages.remotesvc
- ID of the remote service.
-
-