org.objectweb.fractal.rmi
Class RmiProtocol

java.lang.Object
  extended byorg.objectweb.fractal.rmi.RmiProtocol
All Implemented Interfaces:
BindingController, Protocol

public class RmiProtocol
extends Object
implements Protocol, BindingController

Provides a very simple invocation protocol component. This invocation protocol uses only two kinds of messages:

The request identifier is used to associate request and reply messages correctly. The object key identifies the remote object on which the invocation must be performed. The exception flag is used to indicate if a reply contains a normal result or an exception.


Field Summary
protected  NamingContext adapter
          The naming context used to decode the object key contained in request messages.
protected  Logger logger
          The logger used to log messages.
protected  LoggerFactory loggerFactory
          The optional logger factory used to get a logger for this component.
protected  MarshallerFactory marshallerFactory
          The marshaller factory used to create request or reply messages.
protected  Scheduler scheduler
          The scheduler used to synchronized threads for waiting reply messages.
 
Constructor Summary
RmiProtocol()
          Constructs a new RmiProtocol.
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 ProtocolGraph createProtocolGraph(ProtocolGraph[] subgraphs, Context hints)
          Creates a new protocol graph with a number of given sub protocol graphs.
 SessionIdentifier createSessionIdentifier(Properties info, SessionIdentifier[] next)
          Creates a new session identifier with the provided info.
 boolean isAnInvocationProtocol()
          Returns true if the target protocol is an invocation protocol.
 String[] listFc()
           
 Object lookupFc(String clientItfName)
           
 void unbindFc(String clientItfName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adapter

protected NamingContext adapter
The naming context used to decode the object key contained in request messages.


marshallerFactory

protected MarshallerFactory marshallerFactory
The marshaller factory used to create request or reply messages.


scheduler

protected Scheduler scheduler
The scheduler used to synchronized threads for waiting reply messages.


loggerFactory

protected LoggerFactory loggerFactory
The optional logger factory used to get a logger for this component.


logger

protected Logger logger
The logger used to log messages. May be null.

Constructor Detail

RmiProtocol

public RmiProtocol()
Constructs a new RmiProtocol.

Method Detail

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController

lookupFc

public Object lookupFc(String clientItfName)
Specified by:
lookupFc in interface BindingController

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
Specified by:
bindFc in interface BindingController

unbindFc

public void unbindFc(String clientItfName)
Specified by:
unbindFc in interface BindingController

isAnInvocationProtocol

public boolean isAnInvocationProtocol()
Returns true if the target protocol is an invocation protocol. An invocation protocol is a protocol able to handle invocations, i.e., requests expecting a reply. In practice, this means that calls to the prepareInvocation method on sessions obtained from the target protocol will not raise an InternalException, but perform the appropriate work.

Specified by:
isAnInvocationProtocol in interface Protocol
Returns:
true if the target protocol is an invocation protocol.

createProtocolGraph

public ProtocolGraph createProtocolGraph(ProtocolGraph[] subgraphs,
                                         Context hints)
                                  throws JonathanException
Creates a new protocol graph with a number of given sub protocol graphs.

Specified by:
createProtocolGraph in interface Protocol
Parameters:
subgraphs - the lower-level graphs.
hints - the information required to build the graph.
Returns:
a new ProtocolGraph.
Throws:
JonathanException - if the hints or the subgraphs are invalid for this protocol.

createSessionIdentifier

public SessionIdentifier createSessionIdentifier(Properties info,
                                                 SessionIdentifier[] next)
                                          throws JonathanException
Creates a new session identifier with the provided info.

Specified by:
createSessionIdentifier in interface Protocol
Parameters:
info - the information to create the session identifier.
next - lower session identifiers, if any.
Returns:
the created session identifer.
Throws:
JonathanException - if something goes wrong.