jgroup.relacs.gmi
Class GroupInvocationHandler

java.lang.Object
  extended by jgroup.relacs.gmi.GroupInvocationHandler
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.reflect.InvocationHandler, java.rmi.Remote, ExternalGMIService.BootstrapInvocationHandler

public class GroupInvocationHandler
extends java.lang.Object
implements ExternalGMIService.BootstrapInvocationHandler, java.io.Externalizable

Invocation handler (the proxy) at client side. Marshalls call and passes it down to lower layers.

Author:
Tor Arve Stangeland, Hein Meling
See Also:
Serialized Form

Field Summary
static java.lang.String TYPE
          Invocation handler type
 
Constructor Summary
GroupInvocationHandler()
          Constructor for externalization
GroupInvocationHandler(net.jini.jeri.ObjectEndpoint oe, MethodTable methodTable)
          Construct a new GroupInvocationHandler for the given group ObjectEndpoint
 
Method Summary
 GroupEndPoint getGroupEndPoint()
           
 java.lang.String getType()
          Return the invocation handler type
 int hashCode()
          Returns a hash code value for this invocation handler.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
protected  InvocationResult invokeRequest(IID iid, MethodDetails minfo, java.lang.Object[] args, net.jini.jeri.OutboundRequest req)
          Try to invoke method using given request
 void merge(ExternalGMIService.BootstrapInvocationHandler handler)
          Merge this handler with the given handler.
 void readExternal(java.io.ObjectInput in)
           
 void setGroupManager(GroupManager gm)
          Initialize the timestamp service.
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
Invocation handler type

See Also:
Constant Field Values
Constructor Detail

GroupInvocationHandler

public GroupInvocationHandler()
Constructor for externalization


GroupInvocationHandler

public GroupInvocationHandler(net.jini.jeri.ObjectEndpoint oe,
                              MethodTable methodTable)
Construct a new GroupInvocationHandler for the given group ObjectEndpoint

Parameters:
oe - the group object endpoint
methodTable - the table of remote methods accessible through this 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.Exception
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Exception

hashCode

public int hashCode()
Returns a hash code value for this invocation handler.

Overrides:
hashCode in class java.lang.Object

invokeRequest

protected InvocationResult invokeRequest(IID iid,
                                         MethodDetails minfo,
                                         java.lang.Object[] args,
                                         net.jini.jeri.OutboundRequest req)
                                  throws java.io.IOException,
                                         JgroupException
Try to invoke method using given request

Parameters:
iid - Invocation Identifier for invocation
minfo - Method to be invoked
args - Arguments to pass to method
req - OutboundRequest to use
Throws:
java.io.IOException
JgroupException

getGroupEndPoint

public GroupEndPoint getGroupEndPoint()

setGroupManager

public void setGroupManager(GroupManager gm)
Initialize the timestamp service. This is required when the proxy is being used by a replicated client group.

Parameters:
gm - The group manager of the client group.

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

getType

public java.lang.String getType()
Description copied from interface: ExternalGMIService.BootstrapInvocationHandler
Return the invocation handler type

Specified by:
getType in interface ExternalGMIService.BootstrapInvocationHandler

merge

public void merge(ExternalGMIService.BootstrapInvocationHandler handler)
           throws JgroupException,
                  java.rmi.RemoteException
Description copied from interface: ExternalGMIService.BootstrapInvocationHandler
Merge this handler with the given handler.

Specified by:
merge in interface ExternalGMIService.BootstrapInvocationHandler
Parameters:
handler - BootstrapInvoationHandler handler to merge with
Throws:
JgroupException - if merge failed for some reason
java.rmi.RemoteException


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.