jrunx.rmi
Class RemoteInvocationHandler
java.lang.Object
|
+--jrunx.rmi.RemoteInvocationHandler
- All Implemented Interfaces:
- ClusterConstants, java.io.Externalizable, java.lang.reflect.InvocationHandler, RemoteConstants, java.io.Serializable
- Direct Known Subclasses:
- ClientInvocationHandlerImpl
- public class RemoteInvocationHandler
- extends java.lang.Object
- implements RemoteConstants, java.lang.reflect.InvocationHandler, java.io.Externalizable
The client-side class that creates invocations to be sent to the remote RMIBroker.
It is configured with a list of stubs to remote servers, and this list is used
as the "starter" stubs for invocations. When an Invocation is created, it uses
these stubs in conjunction with a ClusterAlgorithm to locate and invoke itself on a
remote server. The invocation itself is passed across the wire and returned to this
handler with updated stubs, so that the handler can receive callback information
about the failure and addition of new services in the cluster in which it is interested.
The EJB server's ClientInvocationHandlerImpl extends this class, and this class is used
directly by the remote JNDI and remote Service invocation subsystems.
- Author:
- PS Neville
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rmiMarshalling
protected boolean rmiMarshalling
system
protected int system
subsystem
protected java.lang.String subsystem
initialServers
protected java.util.ArrayList initialServers
clusterAlgorithm
protected ClusterAlgorithm clusterAlgorithm
invocationClass
protected java.lang.String invocationClass
RemoteInvocationHandler
public RemoteInvocationHandler()
RemoteInvocationHandler
public RemoteInvocationHandler(ClusterableServiceAdapter svc)
setRmiMarshalling
public void setRmiMarshalling(boolean rmiMarshalling)
getClusterAlgorithm
public ClusterAlgorithm getClusterAlgorithm()
setClusterAlgorithm
public void setClusterAlgorithm(ClusterAlgorithm clusterAlgorithm)
getSystem
public int getSystem()
setSystem
public void setSystem(int system)
getSubsystem
public java.lang.String getSubsystem()
setSubsystem
public void setSubsystem(java.lang.String subsystem)
getAvailableServers
public java.util.ArrayList getAvailableServers()
setAvailableServers
public void setAvailableServers(java.util.ArrayList availableServers)
addAvailableServer
public void addAvailableServer(ClusterableService svc)
invoke
public java.lang.Object invoke(java.lang.Object o,
java.lang.reflect.Method method,
java.lang.Object[] objects)
throws java.lang.Throwable
- Specified by:
invoke in interface java.lang.reflect.InvocationHandler
invoke
protected java.lang.Object invoke(Invocation inv)
throws java.lang.Throwable
- Get the appropriate server stub for the operation and invoke the operation,
which may transform the Invocation with event info (cluster callbacks).
If a RemoteException occurs, the method will be invoked on another stub, if possible.
This will cause a RemoteException if there are no more valid stubs for the algorithm to use,
which will be propagated to the caller. Other applications will be propagated without
reinvoking on other stubs.
matchesStubType
protected boolean matchesStubType(java.util.ArrayList stubs)
getInvocation
protected Invocation getInvocation(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args)
throws java.lang.Exception
- Get or create the Invocation object to encapsulate the method invocation.
writeExternal
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
- Specified by:
writeExternal in interface java.io.Externalizable
readExternal
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Specified by:
readExternal in interface java.io.Externalizable
toStubs
protected java.util.ArrayList toStubs(java.util.ArrayList services)
Copyright � 2002 Macromedia Corporation. All Rights Reserved.