|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.objectweb.jeremie.libs.presentation.std.StdMarshallerFactory.StdMarshaller
StdMarshaller is an (abstract) implementation of Marshaller.
Field Summary | |
protected org.objectweb.jonathan.apis.kernel.Context |
context
|
protected Chunk |
current
|
protected Chunk |
first
|
protected int |
offset
|
protected org.objectweb.jeremie.libs.presentation.std.StdMarshallerFactory.JRMIOutputStream |
os
|
protected int |
top
|
Constructor Summary | |
StdMarshallerFactory.StdMarshaller()
|
Method Summary | |
void |
close()
This method causes the message to lose all its references to the underlying chunks, and release each
of them. |
org.objectweb.jonathan.apis.kernel.Context |
getContext()
Returns a Context associated with this marshaller. |
int |
getOffset()
Returns the current offset in the message, i.e., 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). |
java.io.OutputStream |
outputStream()
Returns an output stream to write into the message. |
protected void |
prepare()
|
void |
reset()
This method causes the message to lose all its references to the underlying chunks, without releasing
them. |
boolean |
sameContents(Marshaller other)
Checks if the target marshaller and the provided one have the same contents, i.e., they contain the same bits. |
void |
setOffset(int off)
Sets the offset in the message. |
void |
write(byte[] array,
int off,
int len)
Writes 'len' bytes from the specified byte array starting at offset 'off' to this output message. |
void |
write(Chunk chunk)
Writes a chunk in the message. |
void |
write(int b)
Writes the specified byte to this message. |
void |
writeBoolean(boolean v)
Writes a boolean in a message. |
void |
writeByte(byte v)
Writes a byte in a message. |
void |
writeByteArray(byte[] array,
int off,
int len)
Writes an array of bytes in a message. |
void |
writeChar8(char v)
Writes a char in a message. |
void |
writeException(java.lang.Exception ex)
Writes an exception thrown by a remote method invocation to an underlying stream. |
void |
writeMethod(java.lang.reflect.Method method)
Writes the method in a remote method invocation to an underlying stream. |
void |
writeParameters(java.lang.Object[] params)
Writes the arguments in a remote method invocation to an underlying stream. |
void |
writeReference(java.lang.Object value)
Method used by stubs when they need to send interfaces references. |
void |
writeResult(java.lang.Object result)
Writes the result of a remote method invocation to an underlying stream. |
void |
writeString8(java.lang.String str)
Writes a string in a message. |
void |
writeValue(java.lang.Object value)
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 |
Methods inherited from interface org.objectweb.jonathan.apis.presentation.Marshaller |
isLittleEndian, writeChar16, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeString16 |
Field Detail |
protected Chunk first
protected Chunk current
protected int offset
protected int top
protected org.objectweb.jeremie.libs.presentation.std.StdMarshallerFactory.JRMIOutputStream os
protected org.objectweb.jonathan.apis.kernel.Context context
Constructor Detail |
public StdMarshallerFactory.StdMarshaller()
Method Detail |
public void write(Chunk chunk)
Marshaller
The target becomes the "owner" of the provided chunk, and therefore is not supposed to duplicate it. If the entity invoking this operation wants to keep a reference to the chunk, it must be duplicated.
write
in interface Marshaller
chunk
- the chunk to be written.public Chunk getState()
Marshaller
The returned chunk(s) are NOT duplicated. If the caller keeps a
reference to them, it must reset
the message, and not
continue to use it.
getState
in interface Marshaller
public int getOffset()
Marshaller
getOffset
in interface Marshaller
public void setOffset(int off)
Marshaller
This method may be used to override data already written into the message.
setOffset
in interface Marshaller
off
- the new offset.public void reset()
Marshaller
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 void close()
Marshaller
release
each
of them. It also released the context.
close
in interface Marshaller
public java.io.OutputStream outputStream()
Marshaller
outputStream
in interface Marshaller
public final org.objectweb.jonathan.apis.kernel.Context getContext()
Marshaller
Context
associated with this marshaller.
getContext
in interface Marshaller
Context
associated with this marshaller.public final boolean sameContents(Marshaller other)
Marshaller
sameContents
in interface Marshaller
other
- a marshaller;
public void writeByte(byte v) throws org.objectweb.jonathan.apis.kernel.JonathanException
writeByte
in interface Marshaller
v
- a byte;
org.objectweb.jonathan.apis.kernel.JonathanException
- if an error occurs.public void writeBoolean(boolean v) throws org.objectweb.jonathan.apis.kernel.JonathanException
writeBoolean
in interface Marshaller
v
- a boolean;
org.objectweb.jonathan.apis.kernel.JonathanException
- if an error occurs.public void writeChar8(char v) throws org.objectweb.jonathan.apis.kernel.JonathanException
writeChar8
in interface Marshaller
v
- a char;
org.objectweb.jonathan.apis.kernel.JonathanException
- if an error occurs.public void writeString8(java.lang.String str) throws org.objectweb.jonathan.apis.kernel.JonathanException
writeString8
in interface Marshaller
str
- a string;
org.objectweb.jonathan.apis.kernel.JonathanException
- if an error occurs.public final void writeReference(java.lang.Object value) throws org.objectweb.jonathan.apis.kernel.JonathanException
writeReference
in interface Marshaller
value
- an object reference
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.public final void writeValue(java.lang.Object value) throws org.objectweb.jonathan.apis.kernel.JonathanException
Marshaller
writeValue
in interface Marshaller
value
- an object
org.objectweb.jonathan.apis.kernel.JonathanException
- if a marshal error occurred.public void writeByteArray(byte[] array, int off, int len) throws org.objectweb.jonathan.apis.kernel.JonathanException
writeByteArray
in interface Marshaller
array
- an array of bytes;
org.objectweb.jonathan.apis.kernel.JonathanException
- if an error occurs.public final void write(int b) throws java.io.IOException
This method calls the write(byte) method.
b
- the byte.
java.io.IOException
- if no buffer to write to could be obtained.public final void write(byte[] array, int off, int len) throws java.io.IOException
off
- the start offset in the data.len
- the number of bytes to write.
java.io.IOException
public void writeMethod(java.lang.reflect.Method method) throws java.rmi.MarshalException
JRMIMarshaller
writeMethod
in interface JRMIMarshaller
method
- the method to be written.
java.rmi.MarshalException
- if something goes wrong.public void writeParameters(java.lang.Object[] params) throws java.rmi.MarshalException
JRMIMarshaller
writeParameters
in interface JRMIMarshaller
params
- the objects representing the arguments.
java.rmi.MarshalException
- if something goes wrong.public void writeResult(java.lang.Object result) throws java.rmi.MarshalException
JRMIMarshaller
writeResult
in interface JRMIMarshaller
result
- the object representing the result.
java.rmi.MarshalException
- if something goes wrong.public void writeException(java.lang.Exception ex) throws java.rmi.MarshalException
JRMIMarshaller
writeException
in interface JRMIMarshaller
ex
- the thrown exception.
java.rmi.MarshalException
- if something goes wrong.protected void prepare() throws org.objectweb.jonathan.apis.kernel.JonathanException
org.objectweb.jonathan.apis.kernel.JonathanException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |