org.objectweb.jeremie.protocols.giop
Class GIOPProtocol

java.lang.Object
  extended by org.objectweb.jeremie.protocols.giop.GIOPProtocol
All Implemented Interfaces:
org.objectweb.jonathan.protocols.api.Protocol

public final class GIOPProtocol
extends Object
implements org.objectweb.jonathan.protocols.api.Protocol

GIOPProtocol is an implementation of the GIOP protocol.


Field Summary
static String corba_prefix
          Constant used for IDL repository ids.
 boolean verbose
          Indicates whether warning messages should be printed to stderr.
 
Constructor Summary
GIOPProtocol(org.objectweb.jonathan.resources.api.Scheduler scheduler, org.objectweb.jonathan.presentation.api.MarshallerFactory marshaller_factory, org.objectweb.jonathan.resources.api.ChunkFactory chunk_factory, ServicesHandler services_handler, org.objectweb.jonathan.apis.kernel.ClassPathFinder finder, boolean verbose, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
          Creates a new GIOP Protocol instance.
 
Method Summary
 org.objectweb.jonathan.protocols.api.ProtocolGraph createProtocolGraph(org.objectweb.jonathan.protocols.api.ProtocolGraph[] subgraphs, org.objectweb.jonathan.apis.kernel.Context hints)
          Creates a GIOP Protocol graph.
 org.objectweb.jonathan.protocols.api.SessionIdentifier createSessionIdentifier(Properties info, org.objectweb.jonathan.protocols.api.SessionIdentifier[] next)
          Creates a GIOP Session Identifier
 boolean isAnInvocationProtocol()
          Returns true: GIOP handles invocations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

corba_prefix

public static final String corba_prefix
Constant used for IDL repository ids.

See Also:
Constant Field Values

verbose

public boolean verbose
Indicates whether warning messages should be printed to stderr. This constant is defined under the name /jeremie/giop/verbose in the bootstrap context.

Constructor Detail

GIOPProtocol

public GIOPProtocol(org.objectweb.jonathan.resources.api.Scheduler scheduler,
                    org.objectweb.jonathan.presentation.api.MarshallerFactory marshaller_factory,
                    org.objectweb.jonathan.resources.api.ChunkFactory chunk_factory,
                    ServicesHandler services_handler,
                    org.objectweb.jonathan.apis.kernel.ClassPathFinder finder,
                    boolean verbose,
                    org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
             throws org.objectweb.jonathan.apis.kernel.JonathanException
Creates a new GIOP Protocol instance.

The adapter parameter represents a naming context that will be used to forward requests to their recipient: when GIOP decodes requests, the recipient is encoded as an array of bytes (the object key), that must be the encoding of an identifier for adapter. GIOP will thus ask adapter to decode this identifier. The isValid and resolve operations on the returned identifier may be used respectively to test the existence of the target object, and its presence locally. If the resolve doesn't return null, it should return a CORBA object reference, that may be returned in a forward reply (or in case a locate request has been issued). Else, the identifier is bound. The returned object must be of type RequestSession.

The services_handler parameter will be called each time a message is sent or received, so that the appropriate services are provided.

Parameters:
scheduler - the scheduler corresponding to the kernel;
marshaller_factory - a marshaller factory;
chunk_factory - a chunk factory;
services_handler - a services handler (may be null);
finder - a classpath finder (class loader)
verbose - should we display messages on the log?
context_factory - a context factory
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something goes wrong.
Method Detail

isAnInvocationProtocol

public boolean isAnInvocationProtocol()
Returns true: GIOP handles invocations.

Specified by:
isAnInvocationProtocol in interface org.objectweb.jonathan.protocols.api.Protocol
Returns:
true.

createProtocolGraph

public org.objectweb.jonathan.protocols.api.ProtocolGraph createProtocolGraph(org.objectweb.jonathan.protocols.api.ProtocolGraph[] subgraphs,
                                                                              org.objectweb.jonathan.apis.kernel.Context hints)
                                                                       throws org.objectweb.jonathan.apis.kernel.JonathanException
Creates a GIOP Protocol graph.

Specified by:
createProtocolGraph in interface org.objectweb.jonathan.protocols.api.Protocol
Parameters:
subgraphs - lower level protocol graphs. There should be exactly one!
hints - should have a key named "adapter" with an object adapter as value.
Returns:
a GIOP Protocol Graph
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if the arguments are invalid.

createSessionIdentifier

public org.objectweb.jonathan.protocols.api.SessionIdentifier createSessionIdentifier(Properties info,
                                                                                      org.objectweb.jonathan.protocols.api.SessionIdentifier[] next)
                                                                               throws org.objectweb.jonathan.apis.kernel.JonathanException
Creates a GIOP Session Identifier

Specified by:
createSessionIdentifier in interface org.objectweb.jonathan.protocols.api.Protocol
Parameters:
info - ignored
next - the lower level session ids. There should be exactly one.
Returns:
a new GIOP session identifier
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if something is awry.