org.objectweb.jeremie.libs.binding.jiop
Class JIOP

java.lang.Object
  extended byorg.objectweb.jeremie.libs.binding.jiop.JIOP
All Implemented Interfaces:
JRMIBFactory, NamingContext

public class JIOP
extends java.lang.Object
implements JRMIBFactory

Provides an implementation of a binder for binding Jeremie identifiers to remote objects using a simple protocol built on top of IIOP.


Constructor Summary
protected JIOP()
          Creates a JIOP binder.
  JIOP(JRMIStubFactory stub_factory)
           
 
Method Summary
 java.lang.Object bind(java.lang.String type, java.lang.String host, int port, byte[] key)
          Uses the underlying IIOP binder to bind an identifier, constructed from the host, port, key and type, returning an object giving access to a target object.
 Identifier decode(byte[] data, int offset, int length)
          Uses the underlying IIOP binder to decode an identifier from the given buffered data.
 Identifier decode(UnMarshaller u)
          Uses the underlying IIOP binder to decode an identifier from the given unmarshaller.
 Identifier export(java.lang.Object id, org.objectweb.jonathan.apis.kernel.Context hints)
          Exports the given identifier to an underlying IIOP binder.
 JRMIStubFactory getStubFactory()
          Returns the stub factory associated with this binder viewed as a Jeremie binding factory.
 void setBinder(IIOPBinder binder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIOP

protected JIOP()
Creates a JIOP binder.


JIOP

public JIOP(JRMIStubFactory stub_factory)
Method Detail

setBinder

public void setBinder(IIOPBinder binder)

export

public Identifier export(java.lang.Object id,
                         org.objectweb.jonathan.apis.kernel.Context hints)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Exports the given identifier to an underlying IIOP binder. id must be of type Identifier.

Specified by:
export in interface NamingContext
Parameters:
id - an identifier;
hints - other data that may be useful for the export;
Returns:
the IIOP identifier resulting from the export.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.
See Also:
naming_context.export(org.objectweb.jonathan.model.name)

bind

public java.lang.Object bind(java.lang.String type,
                             java.lang.String host,
                             int port,
                             byte[] key)
                      throws org.objectweb.jonathan.apis.kernel.JonathanException
Uses the underlying IIOP binder to bind an identifier, constructed from the host, port, key and type, returning an object giving access to a target object.

Parameters:
type - a type, forming part of an identifier for the target object;
host - a host, forming part of an identifier for the target object;
port - a port, forming part of an identifier for the target object;
key - an object key, forming part of an identifier for the target object.
Returns:
an object giving access to the target object.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

decode

public Identifier decode(byte[] data,
                         int offset,
                         int length)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Uses the underlying IIOP binder to decode an identifier from the given buffered data.

Specified by:
decode in interface NamingContext
Parameters:
data - the byte array from which to read the encoded identifier;
offset - offset of the first byte of the encoding;
length - the 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)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Uses the underlying IIOP binder to decode an identifier from the given unmarshaller.

Specified by:
decode in interface NamingContext
Parameters:
u - an unmarshaller.
Returns:
an identifier managed by the target naming context;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.

getStubFactory

public JRMIStubFactory getStubFactory()
Returns the stub factory associated with this binder viewed as a Jeremie binding factory.

Specified by:
getStubFactory in interface JRMIBFactory
Returns:
a Jeremie stub factory.