org.objectweb.jonathan.libs.binding.soa
Class SingleOAdapter

java.lang.Object
  extended byorg.objectweb.jonathan.libs.binding.soa.SingleOAdapter
All Implemented Interfaces:
NamingContext

public class SingleOAdapter
extends java.lang.Object
implements NamingContext

SingleOAdapter is an adapter for a single, persistent object. Since there is no object table, there is no need for an object key: the encoding of the identifiers created by SingleOAdapter instances is an array of bytes of length 0.


Constructor Summary
SingleOAdapter()
          Creates a new SingleOAdapter.
 
Method Summary
 Identifier decode(byte[] data, int offset, int length)
          Decodes an identifier from a buffer portion.
 Identifier decode(UnMarshaller u)
          Decodes an identifier from the provided unmarshaller.
 Identifier export(java.lang.Object impl, org.objectweb.jonathan.apis.kernel.Context hints)
          Exports the provided implementation to the target adapter, and then recursively to the naming context in the context.
 Identifier export(java.lang.Object impl, org.objectweb.jonathan.apis.kernel.Context hints, NamingContext nc)
          Exports the provided implementation to the target adapter, and then recursively to the provided naming context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleOAdapter

public SingleOAdapter()
Creates a new SingleOAdapter.

Method Detail

decode

public Identifier decode(byte[] data,
                         int offset,
                         int length)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Decodes an identifier from a buffer portion.

Specified by:
decode in interface NamingContext
Parameters:
data - the byte array to read the encoded identifier from;
offset - offset of the first byte of the encoding;
length - length of the encoding;
Returns:
a decoded identifier;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

decode

public Identifier decode(UnMarshaller u)
Decodes an identifier from the provided unmarshaller.

Specified by:
decode in interface NamingContext
Parameters:
u - an unmarhaller;
Returns:
an identifier managed by the target naming context;

export

public Identifier export(java.lang.Object impl,
                         org.objectweb.jonathan.apis.kernel.Context hints)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Exports the provided implementation to the target adapter, and then recursively to the naming context in the context.

The hints parameter must contain a component named naming_context, of type NamingContext, otherwise an export exception is raised.

The returned identifier is the identifier returned by the export call on the found naming context. The hints parameter is passed as an argument in this method call.

Specified by:
export in interface NamingContext
Parameters:
impl - an object implementation;
hints - a context containing a NamingContext instance;
Returns:
an object identifier.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.
See Also:
naming_context.export(org.objectweb.jonathan.model.name)

export

public Identifier export(java.lang.Object impl,
                         org.objectweb.jonathan.apis.kernel.Context hints,
                         NamingContext nc)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Exports the provided implementation to the target adapter, and then recursively to the provided naming context. The returned identifier is the identifier returned by the export call on nc;

Parameters:
impl - an object implementation;
hints - hints passed to the export method of nc;
nc - a naming context instance (should not be null);
Returns:
an object identifier.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.