org.exolab.jms.net.orb
Class AbstractORB

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

public abstract class AbstractORB
extends java.lang.Object
implements ORB

Abstract implementation of the ORB interface.

Version:
$Revision: 1.8 $ $Date: 2005/11/18 03:25:51 $
Author:
Tim Anderson

Fields inherited from interface org.exolab.jms.net.orb.ORB
PROVIDER_URI, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL
 
Constructor Summary
AbstractORB(java.lang.ClassLoader loader, java.util.Map properties)
          Construct a new AbstractORB.
 
Method Summary
protected abstract  void accept(URI uri)
          Accept connections on the specified URI.
 void addRoute(java.lang.String uri, java.lang.String toURI)
          Add a route for exported objects.
protected abstract  URI connect(URI uri, java.lang.String principal, java.lang.String credentials)
          Connect to the specified URI.
protected  Proxy doExportTo(java.lang.Object object, URI uri)
          Export an object to a specific URI.
 Proxy exportObject(java.lang.Object object)
          Export an object on a default URI.
 Proxy exportObject(java.lang.Object object, java.rmi.server.ObjID objID)
          Export an object with a well known identifier on a default URI.
 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.
 Proxy exportObject(java.lang.Object object, java.lang.String uri)
          Export an object on a specific URI.
 Proxy exportObjectTo(java.lang.Object object, java.lang.String uri)
          Export an object to a specific URI.
 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.
protected  int getExported()
          Returns the no.
 java.lang.Object getObject(java.rmi.server.ObjID objID, java.lang.String uri)
          Returns the object associated with the specified ID, and URI.
protected  java.util.Map getProperties()
          Returns the configuration properties.
 Proxy getProxy(java.lang.Object object, java.lang.String uri)
          Returns the proxy associated with the specified object, and URI.
protected  java.lang.ClassLoader getProxyClassLoader()
          Returns the proxy class loader.
 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
 
Methods inherited from interface org.exolab.jms.net.orb.ORB
addCallerListener, exportObjectTo, getCaller, getRegistry, getRegistry, removeCallerListener, shutdown
 

Constructor Detail

AbstractORB

public AbstractORB(java.lang.ClassLoader loader,
                   java.util.Map properties)
Construct a new AbstractORB.
Parameters:
loader - the class loader to load proxies
properties - properties to configure this with. May be null.
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 ORB
Parameters:
uri - the URI to route
toURI - the URI to route to
Throws:
java.rmi.RemoteException - for any error

getProxy

public Proxy getProxy(java.lang.Object object,
                      java.lang.String uri)
               throws java.rmi.NoSuchObjectException
Returns the proxy associated with the specified object, and URI.
Parameters:
object - the object to look up the proxy for
uri - the URI the object was exported on
Returns:
the proxy corresponding to object and uri
Throws:
java.rmi.NoSuchObjectException - if the object hasn't been exported on the specified URI

getObject

public java.lang.Object getObject(java.rmi.server.ObjID objID,
                                  java.lang.String uri)
                           throws java.rmi.NoSuchObjectException
Returns the object associated with the specified ID, and URI.
Parameters:
objID - the identifier of the object
uri - the URI the object was exported on
Returns:
the object corresponding to objID and uri
Throws:
java.rmi.NoSuchObjectException - if the object hasn't been exported on the specified URI

exportObject

public Proxy exportObject(java.lang.Object object)
                   throws java.rmi.server.ExportException,
                          java.rmi.StubNotFoundException
Export an object on a default URI.
Specified by:
exportObject in interface 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 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 ORB
Parameters:
object - the object to export
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

exportObject

public 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 a default URI.
Specified by:
exportObject in interface 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 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 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 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.
Specified by:
exportObjectTo in interface 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 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 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 ORB
Parameters:
object - the object to export
Throws:
java.rmi.NoSuchObjectException - if the object isn't exported

connect

protected abstract URI connect(URI uri,
                               java.lang.String principal,
                               java.lang.String credentials)
                        throws java.rmi.server.ExportException
Connect to the specified URI.
Parameters:
uri - the URI to establish a connection with
principal - specifies the identity of the principal. If null, indicates to connect anonymously.
credentials - the credentials of the principal
Returns:
the local address that the connection is bound to
Throws:
java.rmi.server.ExportException - for any error

accept

protected abstract void accept(URI uri)
                        throws java.rmi.server.ExportException
Accept connections on the specified URI.
Parameters:
uri - the URI to accept connections on
Throws:
java.rmi.server.ExportException - for any error

getProxyClassLoader

protected java.lang.ClassLoader getProxyClassLoader()
Returns the proxy class loader.
Returns:
the proxy class loader

getProperties

protected java.util.Map getProperties()
Returns the configuration properties.
Returns:
the configuration properties

doExportTo

protected Proxy doExportTo(java.lang.Object object,
                           URI uri)
                    throws java.rmi.server.ExportException,
                           java.rmi.StubNotFoundException
Export an object to a specific URI.
Parameters:
object - the object to export
uri - the URI via which connections to the object are made
Throws:
java.rmi.server.ExportException - if the object cannot be exported
java.rmi.StubNotFoundException - if the proxy class cannot be found

getExported

protected int getExported()
Returns the no. of currently exported objects.
Returns:
the no. of exported objects


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