org.exolab.jms.net.orb
Class UnicastDelegate

java.lang.Object
  |
  +--org.exolab.jms.net.orb.UnicastDelegate
All Implemented Interfaces:
Delegate, java.io.Serializable

public class UnicastDelegate
extends java.lang.Object
implements Delegate, java.io.Serializable

UnicastDelegate supports the invocation of methods on a single remote object, over arbitrary transport protocols.

Version:
$Revision: 1.2 $ $Date: 2005/11/16 12:32:49 $
Author:
Tim Anderson
See Also:
Serialized Form

Constructor Summary
protected UnicastDelegate()
          Default constructor for serialization support.
  UnicastDelegate(java.rmi.server.ObjID objID, Connection connection)
          Construct a new UnicastDelegate.
  UnicastDelegate(java.rmi.server.ObjID objID, java.lang.String uri)
          Construct a new UnicastDelegate.
 
Method Summary
 void dispose()
          Dispose the delegate, releasing any resources.
protected  Connection getConnection()
          Returns the connection to perform invocations.
 java.lang.Object invoke(java.lang.reflect.Method method, java.lang.Object[] args, long methodID)
          Invoke a method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicastDelegate

protected UnicastDelegate()
Default constructor for serialization support.

UnicastDelegate

public UnicastDelegate(java.rmi.server.ObjID objID,
                       java.lang.String uri)
Construct a new UnicastDelegate.

This is intended for use on the server side, to create delegates for serialization to clients.

Parameters:
objID - the identifier of the target object
uri - the connection URI

UnicastDelegate

public UnicastDelegate(java.rmi.server.ObjID objID,
                       Connection connection)
Construct a new UnicastDelegate.

This is intended for use on the client side.

Parameters:
objID - the identifier of the target object
connection - the connection used to make invocations
Method Detail

invoke

public java.lang.Object invoke(java.lang.reflect.Method method,
                               java.lang.Object[] args,
                               long methodID)
                        throws java.lang.Throwable
Invoke a method.
Specified by:
invoke in interface Delegate
Parameters:
method - the method to invoke
args - the arguments to pass
methodID - the unique identifier for the method
Returns:
the result of the invocation
Throws:
java.lang.Throwable - for any error

dispose

public void dispose()
Dispose the delegate, releasing any resources.

It is an error to invoke any method other than this, after the delegate has been disposed.

Specified by:
dispose in interface Delegate

getConnection

protected Connection getConnection()
                            throws InvalidURIException,
                                   ResourceException
Returns the connection to perform invocations.
Returns:
the connection to perform invocations
Throws:
InvalidURIException - if the URI is invalid
ResourceException - if a connection cannot be created


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.