org.objectweb.jonathan.binding.domain
Class JDomain
- NamingContext
Default
domain
implementation.
JDomain implements a
domain
functionality . It uses a
context
to
associate integers and specific naming context types. For instance, to implement
the OMG naming scheme where 0 is associated with IIOP, if the IIOP implementation
is org.objectweb.david.libs.binders.orbs.iiop.IIOPORB, the bootstrap configuration file
should contain the following lines, in the "/jonathan/JDomain" definition:
The first declaration is used when an identifier is marshalled: JDomain gets the class
name of the identifier's context (in this case
org.objectweb.david.libs.binders.orbs.iiop.IIOPORB), and attempts to get the
corresponding value. The value should be an integer, used to designate the naming context.
The second line is used when an identifier is unmarshalled. JDomain knows the
integer id, but may have to dynamically instantiate the corresponding naming
context. To do so, the integer must be associated to a factory that may be
used to retrieve an
instance of the context.
JDomain(Context _initial_context) - Builds a new JDomain instance.
|
NamingContext | bind(int jid) - Returns the context registered under
jid in the target context.
|
Identifier | decode(byte[] data, int offset, int len) - Decodes an identifier from a buffer portion.
|
Identifier | decode(UnMarshaller unmarshaller) - Decodes an identifier from the provided unmarshaller.
|
Identifier | export(Object id, Context hints) - Creates a new identifier for the object interface designated by the
id parameter.
|
void | export(NamingContext context, int jid) - Registers the provided
context under jid in the
target context.
|
void | unexport(int jid) - Unexports the context identified by
jid .
|
JDomain
public JDomain(Context _initial_context)
Builds a new JDomain instance.
_initial_context
corresponds to the Context
describing the naming contexts to register implicitly in the new JDomain.
_initial_context
- describing the naming contexts to register
implicitly in the new JDomain.
bind
public final NamingContext bind(int jid)
Returns the context registered under jid
in the target context.
This method only searched the already instantiated contexts.
jid
- an integer id.
- the context registered under
jid
in the target context.
decode
public final Identifier decode(byte[] data,
int offset,
int len)
Decodes an identifier from a buffer portion.
- decode in interface NamingContext
data
- the byte array to read the encoded identifier from;offset
- offset of the first byte of the encoding;
- a decoded identifier;
decode
public final Identifier decode(UnMarshaller unmarshaller)
throws JonathanException
Decodes an identifier from the provided unmarshaller.
- decode in interface NamingContext
- an identifier managed by the target context;
export
public final Identifier export(Object id,
Context hints)
throws JonathanException
Creates a new identifier for the object interface designated by the
id parameter.
id must be of type
Identifier
- export in interface NamingContext
id
- an identifier managed by another naming context;hints
- additional information (unused);
- an identifier managed by the target naming context.
org.objectweb.jonathan.model.naming_context.export(org.objectweb.jonathan.model.name)
export
public final void export(NamingContext context,
int jid)
throws ExportException
Registers the provided context
under jid
in the
target context. This may override the settings specified when the JDomain
instance was created.
context
- a naming context;jid
- an integer id;
ExportException
- if the id is already in use.
unexport
public final void unexport(int jid)
Unexports the context identified by jid
.
jid
- an integer id.