|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
org.objectweb.fractal.rmi.io.RmiMarshaller
public class 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. |
java.io.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(java.lang.Object v)
Writes an object reference in the marshaller. |
void |
writeShort(short v)
Writes a short. |
void |
writeString16(java.lang.String v)
Writes a string of 16 bits chars. |
void |
writeString8(java.lang.String v)
Writes a string of 8 bits chars. |
void |
writeValue(java.lang.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 Marshallerpublic Context getContext()
Context associated with this marshaller.
getContext in interface MarshallerContext associated with this marshaller.public Chunk getState()
reset the message, and not continue to use it.
getState in interface Marshallerpublic int getOffset()
getOffset in interface MarshallersetOffset(int)public void setOffset(int off)
setOffset in interface Marshalleroff - the new offset.getOffset()public boolean sameContents(Marshaller other)
sameContents in interface Marshallerother - 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 Marshallerpublic java.io.OutputStream outputStream()
outputStream in interface Marshaller
public void writeByte(byte v)
throws JonathanException
writeByte in interface Marshallerv - a byte.
JonathanException - if a marshal error occurred.
public void writeBoolean(boolean v)
throws JonathanException
writeBoolean in interface Marshallerv - a boolean.
JonathanException - if a marshal error occurred.
public void writeChar8(char v)
throws JonathanException
writeChar8 in interface Marshallerv - a char.
JonathanException - if a marshal error occurred.
public void writeChar16(char v)
throws JonathanException
writeChar16 in interface Marshallerv - a char.
JonathanException - if a marshal error occurred.
public void writeShort(short v)
throws JonathanException
writeShort in interface Marshallerv - a short.
JonathanException - if a marshal error occurred.
public void writeInt(int v)
throws JonathanException
writeInt in interface Marshallerv - an int;
JonathanException - if a marshal error occurred.
public void writeFloat(float v)
throws JonathanException
writeFloat in interface Marshallerv - a float.
JonathanException - if a marshal error occurred.
public void writeLong(long v)
throws JonathanException
writeLong in interface Marshallerv - a long.
JonathanException - if a marshal error occurred.
public void writeDouble(double v)
throws JonathanException
writeDouble in interface Marshallerv - a double.
JonathanException - if a marshal error occurred.
public void writeString8(java.lang.String v)
throws JonathanException
writeString8 in interface Marshallerv - a string.
JonathanException - if a marshal error occurred.
public void writeString16(java.lang.String v)
throws JonathanException
writeString16 in interface Marshallerv - a string.
JonathanException - if a marshal error occurred.public void write(Chunk chunk)
write in interface Marshallerchunk - the chunk to be written.
public void writeByteArray(byte[] array,
int off,
int len)
throws JonathanException
writeByteArray in interface Marshallerarray - 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(java.lang.Object v)
throws JonathanException
writeReference in interface Marshallerv - an object reference.
JonathanException - if a marshal error occurred.
public void writeValue(java.lang.Object v)
throws JonathanException
writeValue in interface Marshallerv - an object.
JonathanException - if a marshal error occurred.
public void write(int b)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOException
public void write(byte[] b,
int off,
int len)
throws java.io.IOException
write in class java.io.OutputStreamjava.io.IOExceptionpublic void close()
Marshallerrelease each
of them. It also released the context.
close in interface java.io.Closeableclose in interface Marshallerclose in class java.io.OutputStream
protected void initObjectStream()
throws java.io.IOException
os. This
method creates RmiObjectOutputStream stream.
java.io.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 | |||||||||