|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.dvb.io.ixc.IxcRegistry
This is the bootstrap mechanism for obtaining references to
remote objects residing in other Xlets executing on the same
MHP terminal, using a URL-like syntax. The identification of
a remote
object is given using a syntax indicating the organisation
ID and application ID:
/organisation_id/application_id/name
organisation_id = the organisation ID of the Xlet,
as signalled in the application_identifier
record, defined in the MHP specification.
application_id = the application ID of the Xlet, as
signalled in the application_identifier
record, defined in the MHP specification.
name = the name under which the remote object was
exported.
The organisation ID and the application ID shall be encoded as a hexadecimal string, as would be accepted by java.lang.Integer.parseInt(String s, 16).
When RMI is used to communicate over a network, stubs generated by a tool like rmic are often required. This is not necessary for inter-xlet communication initiated with IxcRegistry. If such stubs are present, they shall be ignored.
Similarly, network RMI objects often extend the class server.RemoteObject, in order to get appropriate implementations for Object.hashCode(), Object.equals(), and Object.toString(). Overriding Object's implementation of these methods in this way is not necessary for inter-xlet communication initiated with IxcRegistry, although it is not harmful. Note that the class server.RemoteObject is not required in all MHP profiles.
Method Summary | |
static void |
bind(javax.tv.xlet.XletContext xc,
java.lang.String name,
java.rmi.Remote obj)
Binds a remote object under a given name in the namespace of an Xlet. |
static void |
bind(javax.tv.xlet.XletContext xc,
java.lang.String name,
java.rmi.Remote obj,
boolean external)
Binds a remote object under a given name in the namespace of an Xlet. |
static java.lang.String[] |
list(javax.tv.xlet.XletContext xc)
Returns an array of string paths objects available in the registry. |
static java.rmi.Remote |
lookup(javax.tv.xlet.XletContext xc,
java.lang.String path)
Returns a remote object previously exported by an Xlet that has not been destroyed. |
static void |
rebind(javax.tv.xlet.XletContext xc,
java.lang.String name,
java.rmi.Remote obj)
Rebind the name to a new object in the context of an Xlet; replaces any existing binding. |
static void |
rebind(javax.tv.xlet.XletContext xc,
java.lang.String name,
java.rmi.Remote obj,
boolean external)
Rebind the name to a new object in the context of an Xlet; replaces any existing binding. |
static void |
unbind(javax.tv.xlet.XletContext xc,
java.lang.String name)
Unbind the name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.rmi.Remote lookup(javax.tv.xlet.XletContext xc, java.lang.String path) throws java.rmi.NotBoundException, java.rmi.RemoteException
The organisation ID and the application ID shall be encoded as a hexadecimal string, as would be accepted by java.lang.Integer.parseInt(String s, 16). If the caller is not authorized to import a given object due to the security policy, then this API will behave as though the object had not been exported, that is, a NotBoundException shall be thrown.
xc
- The context of the current Xlet (that is, the Xlet
importing the object).path
- A file pathname-like string identifying the Xlet and the
name of the object to be imported.java.rmi.NotBoundException
- If the name is not currently bound.java.rmi.RemoteException
- If a remote stub class cannot be generated for
the object being imported.java.lang.IllegalArgumentException
- If the name is not formatted in the syntax given
above.NullPointerException
- if path is nullpublic static void bind(javax.tv.xlet.XletContext xc, java.lang.String name, java.rmi.Remote obj) throws java.rmi.AlreadyBoundException
The object shall be made visible to other applications. A call to bind(xc, name, obj) is thus equivalent to a call to bind(xc, name, obj, true).
xc
- The context of the Xlet exporting the object.name
- The name identifying the object.obj
- The object being exportedjava.rmi.AlreadyBoundException
- if this Xlet has previously exported an object
under the given name.NullPointerException
- if xc, name or obj is nullpublic static void bind(javax.tv.xlet.XletContext xc, java.lang.String name, java.rmi.Remote obj, boolean external) throws java.rmi.AlreadyBoundException
xc
- The context of the Xlet exporting the object.name
- The name identifying the object.obj
- The object being exportedexternal
- Determines if this object is exported outside
the scope of the current application, as defined in
this specification. If set true,
the object shall be visible to other applications;
if false, it shall only be visible to Xlets within
the same application. Note that an embedded Xlet
with a different app ID than its enclosing HTML
page is still considered to be the same application
as that which contains the enclosing page.java.rmi.AlreadyBoundException
- if this Xlet has previously exported an object
under the given name.NullPointerException
- if xc, name or obj is nullpublic static void unbind(javax.tv.xlet.XletContext xc, java.lang.String name) throws java.rmi.NotBoundException
xc
- The context of the Xlet that exported the object to
be unbound.name
- The name identifying the object.java.rmi.NotBoundException
- if this is not currently any object exported by
this Xlet under the given name.NullPointerException
- if xc or name is nullpublic static void rebind(javax.tv.xlet.XletContext xc, java.lang.String name, java.rmi.Remote obj)
The object shall be made visible to other applications. A call to rebind(xc, name, obj) is thus equivalent to a call to rebind(xc, name, obj, true).
xc
- The context of the Xlet that exported the object.name
- The name identifying the object.obj
- The object being exportedNullPointerException
- if xc, name or obj is nullpublic static void rebind(javax.tv.xlet.XletContext xc, java.lang.String name, java.rmi.Remote obj, boolean external)
xc
- The context of the Xlet that exported the object.name
- The name identifying the object.obj
- The object being exportedexternal
- Determines if this object is exported outside
the scope of the current application, as defined in
this specification. If set true,
the object shall be visible to other applications;
if false, it shall only be visible to Xlets within
the same application. Note that an embedded Xlet
with a different app ID than its enclosing HTML
page is still considered to be the same application
as that which contains the enclosing page.NullPointerException
- if xc, name or obj is nullpublic static java.lang.String[] list(javax.tv.xlet.XletContext xc)
xc
- The context of the current Xlet.lookup(javax.tv.xlet.XletContext,String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |