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.
REGISTRY_PORT| Modifier | Constructor and Description |
|---|---|
protected |
IxcRegistry()
Creates the IxcRegistry.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
abstract void |
unbindAll()
Removes the bindings for all remote objects currently exported by
the calling Xlet.
|
protected IxcRegistry()
public static IxcRegistry getRegistry(XletContext context)
context - The context of the Xlet requesting the registry.NullPointerException - If context or
context.getClassLoader() is null.public abstract Remote lookup(String name) throws StubException, NotBoundException
name.
First, if there is a security manager, its
checkPermission method is called with the permission
IxcPermission(name, "lookup").
lookup in interface Registryname - the name of the remote objectNotBoundException - If name is not currently boundStubException - If a stub could not be generated.SecurityException - If the caller does not have the permission
IxcPermission(name, "lookup")IxcPermissionpublic abstract void bind(String name, Remote obj) throws StubException, AlreadyBoundException
name to a remote object.
First, if there is a security manager, its
checkPermission method is called with the permission
IxcPermission(name, "bind").
A pre-check is performed 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.
bind in interface Registryname - the name of the remote objectobj - a reference for the remote object (usually a stub)AlreadyBoundException - if name is already boundStubException - If a stub could not be generated.SecurityException - If the caller does not have the permission
IxcPermission(name, "bind")IxcPermissionpublic abstract void unbind(String name) throws NotBoundException, AccessException
First, if there is a security manager, its
checkPermission method is called with the permission
IxcPermission(name, "bind").
However, names bound to objects exported by the calling xlet are
exempted from this permission check. In other words, xlets are always
allowed to unbind objects they have currently exported.
unbind in interface Registryname - the name of the remote objectSecurityException - If name is not bound to an object exported
by the calling xlet and the caller does not have the permission
IxcPermission(name, "bind").NotBoundException - If name is not currently bound.AccessException - If name is bound to an
object exported in a different registry.IxcPermissionpublic abstract void unbindAll()
public abstract void rebind(String name, Remote obj) throws StubException, AccessException
First, if there is a security manager, its
checkPermission method is called with the permission
IxcPermission(name, "bind").
A pre-check is performed 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.
rebind in interface Registryname - the name of the remote objectobj - new remote object to associate with the nameStubException - If a stub could not be generated.AccessException - If name is bound to an
object exported in a different registry.SecurityException - If the caller does not have the permission
IxcPermission(name, "bind"). In such an event, the remote
object remains bound as before.IxcPermissionpublic abstract String[] list()
IxcPermission(name, "lookup").list in interface RegistryIxcPermissionCopyright © 2012 code4tv.com. All Rights Reserved.