org.objectweb.fractal.rmi.stub
Class Skeleton

java.lang.Object
  extended byorg.objectweb.fractal.rmi.stub.Skeleton
All Implemented Interfaces:
RequestSession

public abstract class Skeleton
extends Object
implements RequestSession

Super class of the skeleton classes generated by the RmiStubFactory. A skeleton gives access to a local interface of a Fractal component. It unmarshalls invocation messages and calls the corresponding methods on the local interface to which it gives access. Like stubs, a skeleton gives access to the "functional" interface provided by a server interface, and also gives access to the methods of the Interface interface implemented by this server interface.


Field Summary
protected  Object target
          The local server interface to which this skeleton gives access.
 
Constructor Summary
Skeleton()
          Constructs a new Skeleton.
 
Method Summary
 Object getTarget()
          Returns the target object represented by this request session.
protected  void handleException(Exception e, ReplySession session)
          Handles an exception that happened in this skeleton.
protected  void handleInterfaceMethods(UnMarshaller unmarshaller, ReplySession session, int methodIndex)
          Handles invocations messages corresponding to methods of the Interface interface.
protected  Object replaceClassName(Object o)
           
protected  Object replaceClassValue(Object o)
           
abstract  void send(UnMarshaller unmarshaller, ReplySession session)
          Sends a message (a request) to its recipient.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

target

protected Object target
The local server interface to which this skeleton gives access.

Constructor Detail

Skeleton

public Skeleton()
Constructs a new Skeleton.

Method Detail

getTarget

public Object getTarget()
Returns the target object represented by this request session.

Specified by:
getTarget in interface RequestSession
Returns:
the target object represented by this request session.

send

public abstract void send(UnMarshaller unmarshaller,
                          ReplySession session)
                   throws JonathanException
Sends a message (a request) to its recipient. The unmarshaller representing the invocation is sent together with a reply session, to be used by the recipient to send the reply. The reply session may be null if no response is expected. It is the responsibility of the recipient to make sure that the unmarshaller will properly be closed.

Specified by:
send in interface RequestSession
Parameters:
unmarshaller - the unmarshaller representing the request.
session - the session to send the reply.
Throws:
JonathanException - if something goes wrong.

handleInterfaceMethods

protected void handleInterfaceMethods(UnMarshaller unmarshaller,
                                      ReplySession session,
                                      int methodIndex)
                               throws JonathanException
Handles invocations messages corresponding to methods of the Interface interface.

Parameters:
unmarshaller - the unmarshaller representing the request.
session - the session to send the reply.
methodIndex - the index of the method to be called.
Throws:
JonathanException - if something goes wrong.

handleException

protected void handleException(Exception e,
                               ReplySession session)
                        throws JonathanException
Handles an exception that happened in this skeleton. This method sends the given exception to the caller by using the given reply session.

Parameters:
e - the exception that happened.
session - the session to send the reply.
Throws:
JonathanException - if the given exception cannot be sent back to the caller.

replaceClassName

protected Object replaceClassName(Object o)
                           throws ClassNotFoundException
Throws:
ClassNotFoundException

replaceClassValue

protected Object replaceClassValue(Object o)