org.objectweb.david.libs.presentation.portable
Class PortableMarshallerFactory

java.lang.Object
  extended byorg.objectweb.david.libs.presentation.portable.PortableMarshallerFactory
All Implemented Interfaces:
org.objectweb.david.libs.presentation.portable.Constants, DavidStreamFactory, MarshallerFactory
Direct Known Subclasses:
CDRMarshallerFactory

public class PortableMarshallerFactory
extends java.lang.Object
implements DavidStreamFactory, org.objectweb.david.libs.presentation.portable.Constants

PortableMarshallerFactory is a factory for "portable" CORBA streams.


Nested Class Summary
 class PortableMarshallerFactory.PortableMarshaller
          PortableMarshaller is an (abstract) implementation of Marshaller.
 class PortableMarshallerFactory.PortableMarshallerL
          PortableMarshallerL is a little endian implementation of Marshaller, extending PortableMarshaller.
 class PortableMarshallerFactory.PortableUnMarshaller
          PortableUnMarshaller is an implementation of UnMarshaller.
 class PortableMarshallerFactory.PortableUnMarshallerD
          PortableUnMarshallerD is an implementation of UnMarshaller.
 
Field Summary
protected  ChunkFactory chunk_factory
          The chunk factory used by this marshaller factory.
static int CHUNKS
           
static int CODEBASE
           
protected  org.objectweb.jonathan.apis.kernel.ContextFactory context_factory
          A context factory to associate contexts with marshallers.
 DavidMarshaller corba_marshaller
          a DavidMarshaller instance, for delegation of the marshalling of the complex CORBA types (Object, TypeCode, Any).
 DavidUnMarshaller corba_unmarshaller
          a DavidUnMarshaller instance, for delegation of the unmarshalling of the complex CORBA types (Object, TypeCode, Any).
static int INDIRECTION_TAG
           
static int MULTIPLE_TYPES
           
static int NULL_TAG
           
static int SINGLE_TYPE
           
static int VALUE_TAG
           
 
Constructor Summary
PortableMarshallerFactory(ChunkFactory chunk_factory)
          Creates a new marshaller factory.
PortableMarshallerFactory(ChunkFactory chunk_factory, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
          Creates a new marshaller factory.
PortableMarshallerFactory(ChunkFactory chunk_factory, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory, DavidMarshallerFactory mf)
          Creates a new marshaller factory.
PortableMarshallerFactory(ChunkFactory chunk_factory, org.objectweb.jonathan.apis.kernel.ContextFactory context_factory, DavidMarshallerFactory mf, org.omg.CORBA.ORB orb)
          Creates a new marshaller factory.
PortableMarshallerFactory(ChunkFactory chunk_factory, DavidMarshallerFactory mf)
          Creates a new marshaller factory.
 
Method Summary
 DavidInputStream newInputStream(Chunk chunk, int read)
          Creates a new input stream, reading data from the specified chunk provider.
 DavidInputStream newInputStream(ChunkProvider message)
          Creates a new input stream, reading data from the provided chunk.
 Marshaller newMarshaller()
          Returns a new (little endian) marshaller.
 DavidOutputStream newOutputStream()
          Returns a (little endian) 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chunk_factory

protected ChunkFactory chunk_factory
The chunk factory used by this marshaller factory.


context_factory

protected org.objectweb.jonathan.apis.kernel.ContextFactory context_factory
A context factory to associate contexts with marshallers.


corba_marshaller

public DavidMarshaller corba_marshaller
a DavidMarshaller instance, for delegation of the marshalling of the complex CORBA types (Object, TypeCode, Any).

It may be null if these types are never used.


corba_unmarshaller

public DavidUnMarshaller corba_unmarshaller
a DavidUnMarshaller instance, for delegation of the unmarshalling of the complex CORBA types (Object, TypeCode, Any).

It may be null if these types are never used.


NULL_TAG

public static final int NULL_TAG
See Also:
Constant Field Values

VALUE_TAG

public static final int VALUE_TAG
See Also:
Constant Field Values

CODEBASE

public static final int CODEBASE
See Also:
Constant Field Values

SINGLE_TYPE

public static final int SINGLE_TYPE
See Also:
Constant Field Values

MULTIPLE_TYPES

public static final int MULTIPLE_TYPES
See Also:
Constant Field Values

CHUNKS

public static final int CHUNKS
See Also:
Constant Field Values

INDIRECTION_TAG

public static final int INDIRECTION_TAG
See Also:
Constant Field Values
Constructor Detail

PortableMarshallerFactory

public PortableMarshallerFactory(ChunkFactory chunk_factory,
                                 org.objectweb.jonathan.apis.kernel.ContextFactory context_factory,
                                 DavidMarshallerFactory mf,
                                 org.omg.CORBA.ORB orb)
Creates a new marshaller factory.

Parameters:
chunk_factory - the chunk factory to be used by the new marshaller factory;
context_factory - a context factory;
mf - a David marshaller factory, only used to initialize corba_marshaller and corba_unmarshaller;
orb - an ORB instance.

PortableMarshallerFactory

public PortableMarshallerFactory(ChunkFactory chunk_factory,
                                 org.objectweb.jonathan.apis.kernel.ContextFactory context_factory,
                                 DavidMarshallerFactory mf)
Creates a new marshaller factory.

Parameters:
chunk_factory - the chunk factory to be used by the new marshaller factory.
context_factory - a context factory
mf - a David marshaller factory, only used to initialize corba_marshaller and corba_unmarshaller.

PortableMarshallerFactory

public PortableMarshallerFactory(ChunkFactory chunk_factory,
                                 org.objectweb.jonathan.apis.kernel.ContextFactory context_factory)
Creates a new marshaller factory.

If this constructor is used,corba_marshaller and corba_unmarshaller are left null.

Parameters:
chunk_factory - the chunk factory to be used by the new marshaller factory.
context_factory - a context factory

PortableMarshallerFactory

public PortableMarshallerFactory(ChunkFactory chunk_factory,
                                 DavidMarshallerFactory mf)
Creates a new marshaller factory.

Parameters:
chunk_factory - the chunk factory to be used by the new marshaller factory.
mf - a David marshaller factory, only used to initialize corba_marshaller and corba_unmarshaller.

PortableMarshallerFactory

public PortableMarshallerFactory(ChunkFactory chunk_factory)
Creates a new marshaller factory.

If this constructor is used,corba_marshaller and corba_unmarshaller are left null.

Parameters:
chunk_factory - the chunk factory to be used by the new marshaller factory.
Method Detail

newMarshaller

public Marshaller newMarshaller()
Returns a new (little endian) marshaller.

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

newOutputStream

public DavidOutputStream newOutputStream()
Returns a (little endian) marshaller.

Specified by:
newOutputStream in interface DavidStreamFactory
Returns:
a new marshaller.

newUnMarshaller

public UnMarshaller newUnMarshaller(Chunk chunk,
                                    int read)
Returns a new unmarshaller, using the provided chunk(s) as a data source.

The read parameters is used to initialise 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.

newInputStream

public DavidInputStream newInputStream(Chunk chunk,
                                       int read)
Creates a new input stream, reading data from the specified chunk provider.

Specified by:
newInputStream in interface DavidStreamFactory
Parameters:
chunk - a chunk;
read - the number of bytes already read from the message.
Returns:
a new input stream.

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.

newInputStream

public DavidInputStream newInputStream(ChunkProvider message)
Creates a new input stream, reading data from the provided chunk.

The read parameters indicates the number of bytes read since the beginning of the message.

Specified by:
newInputStream in interface DavidStreamFactory
Parameters:
message - a chunk provider.
Returns:
a new input stream.