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 IInternalAccesscompThe local component.protected jadex.bridge.component.impl.remotecommands.ProxyReferenceprThe 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 IServicecreateRemoteServiceProxy(IInternalAccess localcomp, IServiceIdentifier remotesvc)Create a proxy object for a remote service.booleanequals(java.lang.Object obj)Test equality.jadex.bridge.component.impl.remotecommands.ProxyReferencegetProxyReference()Get the pr.inthashCode()Hash code.java.lang.Objectinvoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)Invoke a method.booleanisSwitchCall()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.ThrowableInvoke a method.- Specified by:
invokein 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:
isSwitchCallin interfaceISwitchCall- Returns:
- True, if switch should be done.
-
equals
public boolean equals(java.lang.Object obj)
Test equality.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Hash code.- Overrides:
hashCodein 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.
-
-