org.exolab.jms.client.net
Class SharedORB

java.lang.Object
  |
  +--org.exolab.jms.client.net.SharedORB
All Implemented Interfaces:
org.exolab.jms.net.orb.ORB

public class SharedORB
extends java.lang.Object
implements org.exolab.jms.net.orb.ORB

Shared ORB instance.

Version:
$Revision: 1.6 $ $Date: 2005/05/27 14:04:01 $
Author:
Tim Anderson

Fields inherited from interface org.exolab.jms.net.orb.ORB
PROVIDER_URI, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL
 
Method Summary
 void addCallerListener(java.lang.String uri, org.exolab.jms.net.connector.CallerListener listener)
          Register a caller event listener.
 void addRoute(java.lang.String uri, java.lang.String toURI)
          Add a route for exported objects.
 org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object)
          Export an object on the default URI.
 org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object, java.rmi.server.ObjID objID)
          Export an object with a well known identifier on the default URI.
 org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object, java.rmi.server.ObjID objID, java.lang.String uri)
          Export an object with a well known identifier on a specific URI.
 org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object, java.lang.String uri)
          Export an object on a specific URI.
 org.exolab.jms.net.proxy.Proxy exportObjectTo(java.lang.Object object)
          Export an object to the current remote caller.
 org.exolab.jms.net.proxy.Proxy exportObjectTo(java.lang.Object object, java.lang.String uri)
          Export an object to a specific URI.
 org.exolab.jms.net.proxy.Proxy exportObjectTo(java.lang.Object object, java.lang.String uri, java.lang.String principal, java.lang.String credentials)
          Export an object to a specific URI.
 org.exolab.jms.net.connector.Caller getCaller()
          Returns the current caller.
static org.exolab.jms.net.orb.ORB getInstance()
          Returns the singleton ORB instance.
 org.exolab.jms.net.registry.LocalRegistry getRegistry()
          Returns a reference to the registry service.
 org.exolab.jms.net.registry.Registry getRegistry(java.util.Map properties)
          Returns a reference to a remote registry service.
 void removeCallerListener(java.lang.String uri, org.exolab.jms.net.connector.CallerListener listener)
          Deregister a caller event listener.
 void shutdown()
          Shuts down the ORB.
 void unexportObject(java.lang.Object object)
          Unexport an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addRoute

public void addRoute(java.lang.String uri,
                     java.lang.String toURI)
              throws java.rmi.RemoteException
Add a route for exported objects.
Specified by:
addRoute in interface org.exolab.jms.net.orb.ORB
Parameters:
uri - the URI to route
toURI - the URI to route to
Throws:
java.rmi.RemoteException - for any error

getRegistry

public org.exolab.jms.net.registry.LocalRegistry getRegistry()
                                                      throws java.rmi.RemoteException
Returns a reference to the registry service.
Specified by:
getRegistry in interface org.exolab.jms.net.orb.ORB
Returns:
the registry service
Throws:
java.rmi.RemoteException - if the service cannot be exported

getRegistry

public org.exolab.jms.net.registry.Registry getRegistry(java.util.Map properties)
                                                 throws java.rmi.RemoteException
Returns a reference to a remote registry service.
Specified by:
getRegistry in interface org.exolab.jms.net.orb.ORB
Parameters:
properties - the connection properties. May be null.
Returns:
the registry service
Throws:
java.rmi.RemoteException - for any error

exportObject

public org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object)
                                            throws java.rmi.server.ExportException,
                                                   java.rmi.StubNotFoundException
Export an object on the default URI.
Specified by:
exportObject in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

exportObject

public org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object,
                                                   java.lang.String uri)
                                            throws java.rmi.server.ExportException,
                                                   java.rmi.StubNotFoundException
Export an object on a specific URI.
Specified by:
exportObject in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
uri - the URI via which connections to the object are made. If null, the default URI is used.
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

exportObject

public org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object,
                                                   java.rmi.server.ObjID objID)
                                            throws java.rmi.server.ExportException,
                                                   java.rmi.StubNotFoundException
Export an object with a well known identifier on the default URI.
Specified by:
exportObject in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
objID - the well known object identifier
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

exportObject

public org.exolab.jms.net.proxy.Proxy exportObject(java.lang.Object object,
                                                   java.rmi.server.ObjID objID,
                                                   java.lang.String uri)
                                            throws java.rmi.server.ExportException,
                                                   java.rmi.StubNotFoundException
Export an object with a well known identifier on a specific URI.
Specified by:
exportObject in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
objID - the well known object identifier
uri - the URI via which connections to the object are made
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

exportObjectTo

public org.exolab.jms.net.proxy.Proxy exportObjectTo(java.lang.Object object)
                                              throws java.rmi.server.ExportException,
                                                     java.rmi.StubNotFoundException
Export an object to the current remote caller. Only the remote caller may perform invocations.
Specified by:
exportObjectTo in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

exportObjectTo

public org.exolab.jms.net.proxy.Proxy exportObjectTo(java.lang.Object object,
                                                     java.lang.String uri)
                                              throws java.rmi.server.ExportException,
                                                     java.rmi.StubNotFoundException
Export an object to a specific URI. Only callers from the target URI may perform invocations.
Specified by:
exportObjectTo in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
uri - the target URI from which connections to the object are made.
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

exportObjectTo

public org.exolab.jms.net.proxy.Proxy exportObjectTo(java.lang.Object object,
                                                     java.lang.String uri,
                                                     java.lang.String principal,
                                                     java.lang.String credentials)
                                              throws java.rmi.server.ExportException,
                                                     java.rmi.StubNotFoundException
Export an object to a specific URI. Only callers from the target URI may perform invocations.
Specified by:
exportObjectTo in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
uri - the target URI from which connections to the object are made.
principal - the security principal. May be null
credentials - the security credentials. May be null
Returns:
a proxy which may be used to invoke methods on the object
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

unexportObject

public void unexportObject(java.lang.Object object)
                    throws java.rmi.NoSuchObjectException
Unexport an object.
Specified by:
unexportObject in interface org.exolab.jms.net.orb.ORB
Parameters:
object - the object to export
Throws:
java.rmi.NoSuchObjectException - if the object isn't exported

getCaller

public org.exolab.jms.net.connector.Caller getCaller()
                                              throws java.rmi.RemoteException
Returns the current caller.
Specified by:
getCaller in interface org.exolab.jms.net.orb.ORB
Returns:
the current caller, or null if no call is in progress
Throws:
java.rmi.RemoteException - for any error

addCallerListener

public void addCallerListener(java.lang.String uri,
                              org.exolab.jms.net.connector.CallerListener listener)
                       throws java.rmi.RemoteException
Register a caller event listener.
Specified by:
addCallerListener in interface org.exolab.jms.net.orb.ORB
Parameters:
uri - the remote URI to listen on
listener - the listener to notify
Throws:
java.rmi.RemoteException - for any error

removeCallerListener

public void removeCallerListener(java.lang.String uri,
                                 org.exolab.jms.net.connector.CallerListener listener)
                          throws java.rmi.RemoteException
Deregister a caller event listener.
Specified by:
removeCallerListener in interface org.exolab.jms.net.orb.ORB
Parameters:
uri - the remote URI the listener is listening for events on
listener - the listener to remove
Throws:
java.rmi.RemoteException - for any error

shutdown

public void shutdown()
              throws java.rmi.RemoteException
Shuts down the ORB.
Specified by:
shutdown in interface org.exolab.jms.net.orb.ORB
Throws:
java.rmi.RemoteException - for any error

getInstance

public static org.exolab.jms.net.orb.ORB getInstance()
                                              throws java.rmi.RemoteException
Returns the singleton ORB instance.
Returns:
the singleton ORB instance
Throws:
java.rmi.RemoteException - for any error


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