|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream org.objectweb.fractal.rmi.io.RmiMarshaller
A Marshaller
that uses an RmiObjectOutputStream
to
marshall object values.
Field Summary | |
protected ChunkFactory |
chunkFactory
The chunk factory used to create new chunks to marshall data. |
protected ContextFactory |
contextFactory
The context factory used to create the context associated with this marshaller. |
protected NamingContext |
domain
The domain used to instantiate os . |
protected RmiObjectOutputStream |
os
The object output stream used to marshall object values. |
Constructor Summary | |
RmiMarshaller(NamingContext domain,
ChunkFactory chunkFactory,
ContextFactory contextFactory)
Constructs a new RmiMarshaller . |
Method Summary | |
void |
close()
This method causes the message to lose all its references to the underlying chunks, and release each
of them. |
Context |
getContext()
Returns a Context associated with this marshaller. |
int |
getOffset()
Returns the position in the message at which the next byte will be written. |
Chunk |
getState()
Returns the state of the message as a (chain of) chunk(s). |
protected void |
initObjectStream()
Instantiates the delegate object output stream os . |
boolean |
isLittleEndian()
Returns true if this marshaller is little-endian, false otherwise. |
OutputStream |
outputStream()
Returns an output stream to write into the message. |
void |
reset()
Resets this marshaller. |
boolean |
sameContents(Marshaller other)
Checks if the given marshaller has the same content as this one. |
void |
setOffset(int off)
Sets the offset in the message. |
void |
write(byte[] b,
int off,
int len)
|
void |
write(Chunk chunk)
Writes a chunk in the message. |
void |
write(int b)
|
void |
writeBoolean(boolean v)
Writes a boolean. |
void |
writeByte(byte v)
Writes a byte. |
void |
writeByteArray(byte[] array,
int off,
int len)
Writes an array of bytes. |
void |
writeChar16(char v)
Writes a 16 bits char. |
void |
writeChar8(char v)
Writes an 8 bits char. |
void |
writeDouble(double v)
Writes a double. |
void |
writeFloat(float v)
Writes a float. |
void |
writeInt(int v)
Writes an int. |
void |
writeLong(long v)
Writes a long. |
void |
writeReference(Object v)
Writes an object reference in the marshaller. |
void |
writeShort(short v)
Writes a short. |
void |
writeString16(String v)
Writes a string of 16 bits chars. |
void |
writeString8(String v)
Writes a string of 8 bits chars. |
void |
writeValue(Object v)
Writes a value in the marshaller. |
Methods inherited from class java.io.OutputStream |
flush, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected NamingContext domain
os
.
protected ChunkFactory chunkFactory
protected ContextFactory contextFactory
getContext
.
protected RmiObjectOutputStream os
writeValue
or to writeReference
.
Constructor Detail |
public RmiMarshaller(NamingContext domain, ChunkFactory chunkFactory, ContextFactory contextFactory)
RmiMarshaller
.
domain
- the domain to be used to instantiate os
.chunkFactory
- the chunk factory to be used to create new chunks to
marshall data.contextFactory
- the context factory to be used to create the context
associated with this marshaller.Method Detail |
public boolean isLittleEndian()
isLittleEndian
in interface Marshaller
public Context getContext()
Context
associated with this marshaller.
getContext
in interface Marshaller
Context
associated with this marshaller.public Chunk getState()
reset
the message, and not continue to use it.
getState
in interface Marshaller
public int getOffset()
getOffset
in interface Marshaller
setOffset(int)
public void setOffset(int off)
setOffset
in interface Marshaller
off
- the new offset.getOffset()
public boolean sameContents(Marshaller other)
sameContents
in interface Marshaller
other
- a marshaller.
public void reset()
releasing
them. This method must not be used if no reference to chunks
present in the message is held by an entity in charge of their release.
It also releases the context associated with the target marshaller.
reset
in interface Marshaller
public OutputStream outputStream()
outputStream
in interface Marshaller
public void writeByte(byte v) throws JonathanException
writeByte
in interface Marshaller
v
- a byte.
JonathanException
- if a marshal error occurred.public void writeBoolean(boolean v) throws JonathanException
writeBoolean
in interface Marshaller
v
- a boolean.
JonathanException
- if a marshal error occurred.public void writeChar8(char v) throws JonathanException
writeChar8
in interface Marshaller
v
- a char.
JonathanException
- if a marshal error occurred.public void writeChar16(char v) throws JonathanException
writeChar16
in interface Marshaller
v
- a char.
JonathanException
- if a marshal error occurred.public void writeShort(short v) throws JonathanException
writeShort
in interface Marshaller
v
- a short.
JonathanException
- if a marshal error occurred.public void writeInt(int v) throws JonathanException
writeInt
in interface Marshaller
v
- an int;
JonathanException
- if a marshal error occurred.public void writeFloat(float v) throws JonathanException
writeFloat
in interface Marshaller
v
- a float.
JonathanException
- if a marshal error occurred.public void writeLong(long v) throws JonathanException
writeLong
in interface Marshaller
v
- a long.
JonathanException
- if a marshal error occurred.public void writeDouble(double v) throws JonathanException
writeDouble
in interface Marshaller
v
- a double.
JonathanException
- if a marshal error occurred.public void writeString8(String v) throws JonathanException
writeString8
in interface Marshaller
v
- a string.
JonathanException
- if a marshal error occurred.public void writeString16(String v) throws JonathanException
writeString16
in interface Marshaller
v
- a string.
JonathanException
- if a marshal error occurred.public void write(Chunk chunk)
write
in interface Marshaller
chunk
- the chunk to be written.public void writeByteArray(byte[] array, int off, int len) throws JonathanException
writeByteArray
in interface Marshaller
array
- an array of bytes.off
- index of the first byte of the array that must be written.len
- number of bytes of the array that must be written.
JonathanException
- if a marshal error occurred.public void writeReference(Object v) throws JonathanException
writeReference
in interface Marshaller
v
- an object reference.
JonathanException
- if a marshal error occurred.public void writeValue(Object v) throws JonathanException
writeValue
in interface Marshaller
v
- an object.
JonathanException
- if a marshal error occurred.public void write(int b) throws IOException
IOException
public void write(byte[] b, int off, int len) throws IOException
IOException
public void close()
Marshaller
release
each
of them. It also released the context.
close
in interface Marshaller
protected void initObjectStream() throws IOException
os
. This
method creates RmiObjectOutputStream
stream.
IOException
- if the delegate object output stream cannot be created.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |