JSR-62 (Final)

javax.microedition.xlet.ixc
Class IxcRegistry

java.lang.Object
  |
  +--javax.microedition.xlet.ixc.IxcRegistry
All Implemented Interfaces:
Registry, Remote

public abstract class IxcRegistry
extends Object
implements Registry

IxcRegistry is the bootstrap mechanism for obtaining references to remote objects residing in other Xlets executing on the same machine, but in separate classloaders. The IxcRegistry class provides access to a database of objects exported for the purpose of inter-xlet communication (IXC). A single database is shared for all IXC clients on a given machine. Objects stored in the database are identified by a String name of arbitrary format. Each IxcRegistry instance is associated with a single XletContext, in order to identify the IXC client using it.

Instances of IXCRegistry are never accessible via java.rmi.Naming or java.rmi.registry.LocateRegistry if RMI functionality is implemented.

See Also:
Registry, getRegistry(javax.microedition.xlet.XletContext)

Field Summary
 
Fields inherited from interface java.rmi.registry.Registry
REGISTRY_PORT
 
Constructor Summary
protected IxcRegistry()
          Creates the IxcRegistry.
 
Method Summary
abstract  void bind(String name, Remote obj)
          Binds the specified name to a remote object.
static IxcRegistry getRegistry(XletContext context)
          Provides the inter-Xlet communication registry for use by the calling Xlet.
abstract  String[] list()
          Returns an array of the names bound in the registry.
abstract  Remote lookup(String name)
          Returns a reference, a stub, for the remote object associated with the specified name.
abstract  void rebind(String name, Remote obj)
          Rebinds the specified name to a new remote object.
abstract  void unbind(String name)
          Destroys the binding for the specified name that is associated with a remote object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IxcRegistry

protected IxcRegistry()
Creates the IxcRegistry. (This class cannot be instantiated directly.)

See Also:
getRegistry(javax.microedition.xlet.XletContext)
Method Detail

getRegistry

public static IxcRegistry getRegistry(XletContext context)
Provides the inter-Xlet communication registry for use by the calling Xlet.

Note that an implementation of this method may inspect the call stack to determine the classloader of the caller, rather than make direct use of the XletContext parameter.

Parameters:
context - The context of the Xlet requesting the registry.
Returns:
The inter-Xlet communication registry.
Throws:
NullPointerException - If context is null.

lookup

public abstract Remote lookup(String name)
                       throws StubException,
                              NotBoundException
Returns a reference, a stub, for the remote object associated with the specified name.

Specified by:
lookup in interface Registry
Parameters:
name - the name of the remote object
Returns:
a reference for a remote object
Throws:
NotBoundException - If name is not currently bound
StubException - If a stub could not be generated.

bind

public abstract void bind(String name,
                          Remote obj)
                   throws StubException,
                          AlreadyBoundException
Binds the specified name to a remote object. This method performs a pre-check on the Remote object to verify that it conforms to the rules for well-formed Remote interfaces; if it does not, a StubException is thrown.

Specified by:
bind in interface Registry
Parameters:
name - the name of the remote object
obj - a reference for the remote object (usually a stub)
Throws:
AlreadyBoundException - if name is already bound
StubException - If a stub could not be generated.

unbind

public abstract void unbind(String name)
                     throws NotBoundException,
                            AccessException
Destroys the binding for the specified name that is associated with a remote object.

Specified by:
unbind in interface Registry
Parameters:
name - the name of the remote object
Throws:
NotBoundException - if name is not currently bound
AccessException - If name is bound to an object exported by a different Xlet than the caller.

rebind

public abstract void rebind(String name,
                            Remote obj)
                     throws StubException,
                            AccessException
Rebinds the specified name to a new remote object. Any existing binding for the name is replaced.

This method performs a pre-check on the Remote object to verify that it conforms to the rules for well-formed Remote interfaces; if it does not, a StubException is thrown.

Specified by:
rebind in interface Registry
Parameters:
name - the name of the remote object
obj - new remote object to associate with the name
Throws:
StubException - If a stub could not be generated.
AccessException - If name is bound to an object exported by a different Xlet than the caller.

list

public abstract String[] list()
Returns an array of the names bound in the registry. The names are URL-formatted strings. The array contains a snapshot of the names present in the registry at the time of the call.

Specified by:
list in interface Registry
Returns:
an array of names bound in the registry

JSR-62 (Final)

Java and Java 2D are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
Copyright 1993 - 2002 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303, U.S.A. All Rights Reserved.
Use of this specification is subject to this license.