org.objectweb.fractal.rmi.io
Class RmiMarshallerFactory

java.lang.Object
  extended byorg.objectweb.fractal.rmi.io.RmiMarshallerFactory
All Implemented Interfaces:
BindingController, MarshallerFactory

public class RmiMarshallerFactory
extends Object
implements MarshallerFactory, BindingController

Provides a factory for creating marshallers and unmarshallers.


Field Summary
protected  ChunkFactory chunkFactory
          The chunk factory to be used by the (un)marshallers created by this factory.
protected  ContextFactory contextFactory
          The context factory to be used by the (un)marshallers created by this factory.
protected  NamingContext domain
          The domain to be used by the (un)marshallers created by this factory.
 
Constructor Summary
RmiMarshallerFactory()
          Constructs a new RmiMarshallerFactory.
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
          Binds the client interface whose name is given to a server interface.
 String[] listFc()
          Returns the names of the client interfaces of the component to which this interface belongs.
 Object lookupFc(String clientItfName)
          Returns the interface to which the given client interface is bound.
 Marshaller newMarshaller()
          Returns a new marshaller.
 UnMarshaller newUnMarshaller(Chunk chunk, int read)
          Returns a new unmarshaller, using the provided chunk(s) as a data source.
 UnMarshaller newUnMarshaller(ChunkProvider message)
          Returns a new unmarshaller, using the provided chunk provider as a data source.
 void unbindFc(String clientItfName)
          Unbinds the given client interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

domain

protected NamingContext domain
The domain to be used by the (un)marshallers created by this factory.


chunkFactory

protected ChunkFactory chunkFactory
The chunk factory to be used by the (un)marshallers created by this factory.


contextFactory

protected ContextFactory contextFactory
The context factory to be used by the (un)marshallers created by this factory.

Constructor Detail

RmiMarshallerFactory

public RmiMarshallerFactory()
Constructs a new RmiMarshallerFactory.

Method Detail

listFc

public String[] listFc()
Description copied from interface: BindingController
Returns the names of the client interfaces of the component to which this interface belongs.

Specified by:
listFc in interface BindingController
Returns:
the names of the client interfaces of the component to which this interface belongs.

lookupFc

public Object lookupFc(String clientItfName)
Description copied from interface: BindingController
Returns the interface to which the given client interface is bound. More precisely, returns the server interface to which the client interface whose name is given is bound. This server interface is necessarily in the same address space as the client interface (see bindFc).

Specified by:
lookupFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
Returns:
the server interface to which the given interface is bound, or null if it is not bound.

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
Description copied from interface: BindingController
Binds the client interface whose name is given to a server interface. More precisely, binds the client interface of the component to which this interface belongs, and whose name is equal to the given name, to the given server interface. The given server interface must be in the same address space as the client interface.

Specified by:
bindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
serverItf - a server interface.

unbindFc

public void unbindFc(String clientItfName)
Description copied from interface: BindingController
Unbinds the given client interface. More precisely, unbinds the client interface of the component to which this interface belongs, and whose name is equal to the given name.

Specified by:
unbindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.

newMarshaller

public Marshaller newMarshaller()
Returns a new marshaller.

Specified by:
newMarshaller in interface MarshallerFactory
Returns:
a new marshaller.

newUnMarshaller

public UnMarshaller newUnMarshaller(ChunkProvider message)
Returns a new unmarshaller, using the provided chunk provider as a data source.

Specified by:
newUnMarshaller in interface MarshallerFactory
Parameters:
message - a chunk provider.
Returns:
a new unmarshaller.

newUnMarshaller

public UnMarshaller newUnMarshaller(Chunk chunk,
                                    int read)
Returns a new unmarshaller, using the provided chunk(s) as a data source. The read parameter is used to initialize the number of bytes read from the message.

Specified by:
newUnMarshaller in interface MarshallerFactory
Parameters:
chunk - a (chain of) chunk(s).
read - the number of bytes already read from the message.
Returns:
an unmarshaller.