org.objectweb.jeremie.binding.iiop
Class IIOPBinder

java.lang.Object
  extended byorg.objectweb.jeremie.binding.iiop.IIOPBinder
All Implemented Interfaces:
EXOTIC_PROTOCOL_SUPPORT, JAVA_SERIAL_SERVICE, org.objectweb.jonathan.binding.api.NamingContext

public class IIOPBinder
extends Object
implements org.objectweb.jonathan.binding.api.NamingContext, JAVA_SERIAL_SERVICE, EXOTIC_PROTOCOL_SUPPORT

IIOPBinder implements the IIOP protocol (GIOP/TCP/IP). This class should not be used directly by applications, but rather by personnality binders that will instantiate all the parameters: it is an IIOP "delegate" implementation.


Field Summary
 
Fields inherited from interface org.objectweb.jeremie.services.java_serial.api.JAVA_SERIAL_SERVICE
TAG_JAVA_SERIAL
 
Fields inherited from interface org.objectweb.jeremie.services.exotic_protocol.api.EXOTIC_PROTOCOL_SUPPORT
TAG_EXOTIC_PROTOCOL
 
Constructor Summary
IIOPBinder(org.objectweb.jonathan.protocols.api.ProtocolInfo protocol_info, org.objectweb.jonathan.resources.api.Scheduler scheduler, boolean direct_local_optimization, org.objectweb.jonathan.resources.api.ChunkFactory chunk_factory, org.objectweb.jonathan.presentation.api.MarshallerFactory marshaller_factory, org.objectweb.jonathan.stub_factories.api.StubFactory stub_factory, org.objectweb.jonathan.binding.api.NamingContext context, TaggedComponents ior_components, org.objectweb.jonathan.apis.kernel.Context protocolMappings, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory, org.objectweb.jonathan.protocols.tcpip.TcpIpProtocol tcp_protocol, GIOPProtocol giop_protocol)
          Builds a new instance of IIOPBinder.
 
Method Summary
 org.objectweb.jonathan.binding.api.Identifier decode(byte[] data, int offset, int length)
          Decodes an identifier from a buffer portion.
 org.objectweb.jonathan.binding.api.Identifier decode(org.objectweb.jonathan.presentation.api.UnMarshaller u)
          Decodes an identifier from the provided unmarhaller.
 org.objectweb.jonathan.binding.api.Identifier export(Object id, org.objectweb.jonathan.apis.kernel.Context hints)
          Creates a new identifier for the object interface designated by the id parameter.
 org.objectweb.jonathan.binding.api.Identifier newId(String host, int port, byte[] key)
          Creates an IIOP Identifier.
 void setVerbose(boolean verbose)
          Should we print informational messages on the log?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IIOPBinder

public IIOPBinder(org.objectweb.jonathan.protocols.api.ProtocolInfo protocol_info,
                  org.objectweb.jonathan.resources.api.Scheduler scheduler,
                  boolean direct_local_optimization,
                  org.objectweb.jonathan.resources.api.ChunkFactory chunk_factory,
                  org.objectweb.jonathan.presentation.api.MarshallerFactory marshaller_factory,
                  org.objectweb.jonathan.stub_factories.api.StubFactory stub_factory,
                  org.objectweb.jonathan.binding.api.NamingContext context,
                  TaggedComponents ior_components,
                  org.objectweb.jonathan.apis.kernel.Context protocolMappings,
                  org.objectweb.jonathan.apis.kernel.ContextFactory context_factory,
                  org.objectweb.jonathan.protocols.tcpip.TcpIpProtocol tcp_protocol,
                  GIOPProtocol giop_protocol)
           throws org.objectweb.jonathan.apis.kernel.JonathanException
Builds a new instance of IIOPBinder.

If direct_local_optimization is true, it means that the actual server implementation should be returned when a local server reference is unmarshalled. Otherwise, a stub is returned, that will intercept calls to the server.

The context parameter represents the actual IIOP naming context, i.e., the context that delegates its operations to the newly created IIOPBinder.

Parameters:
protocol_info - the static information for building protocol graphs
scheduler - a scheduler
direct_local_optimization - shall we use local optimizations?
chunk_factory - a chunk factory;
marshaller_factory - a marshaller factory;
stub_factory - a stub factory;
context - the actual IIOP binder (the ORB);
ior_components - the components to be included in the created IORs
protocolMappings - maps the numeric protocol ids org.objectweb.jonathan.apis.protocols.ProtocolIdentifiers to instances
context_factory - a context factory
tcp_protocol - the TCP/IP protocol instance to be used on fallback to regular IIOP
giop_protocol - the GIOP protocol instance to be used on fallback to regular IIOP
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.
Method Detail

setVerbose

public void setVerbose(boolean verbose)
Should we print informational messages on the log?

Parameters:
verbose - if true, the Binder displays messages on the log.

export

public org.objectweb.jonathan.binding.api.Identifier export(Object id,
                                                            org.objectweb.jonathan.apis.kernel.Context hints)
                                                     throws org.objectweb.jonathan.apis.kernel.JonathanException
Creates a new identifier for the object interface designated by the id parameter.

The hints member may contain a component named port of type int. If so, its value is used as a preferred port number. id must be of type Identifier.

Specified by:
export in interface org.objectweb.jonathan.binding.api.NamingContext
Parameters:
id - an identifier managed by another naming context;
hints - additional information;
Returns:
an identifier managed by the target naming context.
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something else goes wrong.
See Also:
org.objectweb.jonathan.model.naming_context#export( org.objectweb.jonathan.model.name)

decode

public org.objectweb.jonathan.binding.api.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 org.objectweb.jonathan.binding.api.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 org.objectweb.jonathan.binding.api.Identifier decode(org.objectweb.jonathan.presentation.api.UnMarshaller u)
                                                     throws org.objectweb.jonathan.apis.kernel.JonathanException
Decodes an identifier from the provided unmarhaller.

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

newId

public org.objectweb.jonathan.binding.api.Identifier newId(String host,
                                                           int port,
                                                           byte[] key)
                                                    throws org.objectweb.jonathan.apis.kernel.JonathanException
Creates an IIOP Identifier.

Parameters:
host - a machine host name;
port - a port number;
key - an object key;
Returns:
a bindable IIOP Identifier
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.