org.objectweb.jeremie.presentation.std
Class StdMarshallerFactory.StdMarshaller

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.objectweb.jeremie.presentation.std.StdMarshallerFactory.StdMarshaller
All Implemented Interfaces:
JRMIMarshaller, org.objectweb.jonathan.presentation.api.Marshaller
Direct Known Subclasses:
StdMarshallerFactory.StdMarshallerL
Enclosing class:
StdMarshallerFactory

public abstract class StdMarshallerFactory.StdMarshaller
extends OutputStream
implements JRMIMarshaller

StdMarshaller is an (abstract) implementation of Marshaller.


Field Summary
protected  org.objectweb.jonathan.apis.kernel.Context context
           
protected  org.objectweb.jonathan.resources.api.Chunk current
           
protected  org.objectweb.jonathan.resources.api.Chunk first
           
protected  int offset
           
protected  org.objectweb.jeremie.presentation.std.StdMarshallerFactory.JRMIOutputStream os
           
protected  int top
           
 
Constructor Summary
StdMarshallerFactory.StdMarshaller()
           
 
Method Summary
 void close()
           
 org.objectweb.jonathan.apis.kernel.Context getContext()
           
 int getOffset()
           
 org.objectweb.jonathan.resources.api.Chunk getState()
           
 OutputStream outputStream()
           
protected  void prepare()
           
 void reset()
           
 boolean sameContents(org.objectweb.jonathan.presentation.api.Marshaller other)
           
 void setOffset(int off)
           
 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(org.objectweb.jonathan.resources.api.Chunk chunk)
           
 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(Exception ex)
          Writes an exception thrown by a remote method invocation to an underlying stream.
 void writeMethod(Method method)
          Writes the method in a remote method invocation to an underlying stream.
 void writeParameters(Object[] params)
          Writes the arguments in a remote method invocation to an underlying stream.
 void writeReference(Object value)
          Method used by stubs when they need to send interfaces references.
 void writeResult(Object result)
          Writes the result of a remote method invocation to an underlying stream.
 void writeString8(String str)
          Writes a string in a message.
 void writeValue(Object value)
           
 
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.presentation.api.Marshaller
isLittleEndian, writeChar16, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeString16
 

Field Detail

first

protected org.objectweb.jonathan.resources.api.Chunk first

current

protected org.objectweb.jonathan.resources.api.Chunk current

offset

protected int offset

top

protected int top

os

protected org.objectweb.jeremie.presentation.std.StdMarshallerFactory.JRMIOutputStream os

context

protected org.objectweb.jonathan.apis.kernel.Context context
Constructor Detail

StdMarshallerFactory.StdMarshaller

public StdMarshallerFactory.StdMarshaller()
Method Detail

write

public void write(org.objectweb.jonathan.resources.api.Chunk chunk)
Specified by:
write in interface org.objectweb.jonathan.presentation.api.Marshaller

getState

public org.objectweb.jonathan.resources.api.Chunk getState()
Specified by:
getState in interface org.objectweb.jonathan.presentation.api.Marshaller

getOffset

public int getOffset()
Specified by:
getOffset in interface org.objectweb.jonathan.presentation.api.Marshaller

setOffset

public void setOffset(int off)
Specified by:
setOffset in interface org.objectweb.jonathan.presentation.api.Marshaller

reset

public void reset()
Specified by:
reset in interface org.objectweb.jonathan.presentation.api.Marshaller

close

public void close()
Specified by:
close in interface org.objectweb.jonathan.presentation.api.Marshaller

outputStream

public OutputStream outputStream()
Specified by:
outputStream in interface org.objectweb.jonathan.presentation.api.Marshaller

getContext

public final org.objectweb.jonathan.apis.kernel.Context getContext()
Specified by:
getContext in interface org.objectweb.jonathan.presentation.api.Marshaller

sameContents

public final boolean sameContents(org.objectweb.jonathan.presentation.api.Marshaller other)
Specified by:
sameContents in interface org.objectweb.jonathan.presentation.api.Marshaller

writeByte

public void writeByte(byte v)
               throws org.objectweb.jonathan.apis.kernel.JonathanException
Writes a byte in a message.

Specified by:
writeByte in interface org.objectweb.jonathan.presentation.api.Marshaller
Parameters:
v - a byte;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.

writeBoolean

public void writeBoolean(boolean v)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Writes a boolean in a message.

Specified by:
writeBoolean in interface org.objectweb.jonathan.presentation.api.Marshaller
Parameters:
v - a boolean;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.

writeChar8

public void writeChar8(char v)
                throws org.objectweb.jonathan.apis.kernel.JonathanException
Writes a char in a message.

Specified by:
writeChar8 in interface org.objectweb.jonathan.presentation.api.Marshaller
Parameters:
v - a char;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.

writeString8

public void writeString8(String str)
                  throws org.objectweb.jonathan.apis.kernel.JonathanException
Writes a string in a message.

Specified by:
writeString8 in interface org.objectweb.jonathan.presentation.api.Marshaller
Parameters:
str - a string;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.

writeReference

public final void writeReference(Object value)
                          throws org.objectweb.jonathan.apis.kernel.JonathanException
Method used by stubs when they need to send interfaces references.

Specified by:
writeReference in interface org.objectweb.jonathan.presentation.api.Marshaller
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException

writeValue

public final void writeValue(Object value)
                      throws org.objectweb.jonathan.apis.kernel.JonathanException
Specified by:
writeValue in interface org.objectweb.jonathan.presentation.api.Marshaller
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException

writeByteArray

public void writeByteArray(byte[] array,
                           int off,
                           int len)
                    throws org.objectweb.jonathan.apis.kernel.JonathanException
Writes an array of bytes in a message.

Specified by:
writeByteArray in interface org.objectweb.jonathan.presentation.api.Marshaller
Parameters:
array - an array of bytes;
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.

write

public final void write(int b)
                 throws IOException
Writes the specified byte to this message.

This method calls the write(byte) method.

Parameters:
b - the byte.
Throws:
IOException - if no buffer to write to could be obtained.

write

public final void write(byte[] array,
                        int off,
                        int len)
                 throws IOException
Writes 'len' bytes from the specified byte array starting at offset 'off' to this output message.

Parameters:
off - the start offset in the data.
len - the number of bytes to write.
Throws:
IOException

writeMethod

public void writeMethod(Method method)
                 throws MarshalException
Description copied from interface: JRMIMarshaller
Writes the method in a remote method invocation to an underlying stream.

Specified by:
writeMethod in interface JRMIMarshaller
Parameters:
method - the method to be written.
Throws:
MarshalException - if something goes wrong.

writeParameters

public void writeParameters(Object[] params)
                     throws MarshalException
Description copied from interface: JRMIMarshaller
Writes the arguments in a remote method invocation to an underlying stream.

Specified by:
writeParameters in interface JRMIMarshaller
Parameters:
params - the objects representing the arguments.
Throws:
MarshalException - if something goes wrong.

writeResult

public void writeResult(Object result)
                 throws MarshalException
Description copied from interface: JRMIMarshaller
Writes the result of a remote method invocation to an underlying stream.

Specified by:
writeResult in interface JRMIMarshaller
Parameters:
result - the object representing the result.
Throws:
MarshalException - if something goes wrong.

writeException

public void writeException(Exception ex)
                    throws MarshalException
Description copied from interface: JRMIMarshaller
Writes an exception thrown by a remote method invocation to an underlying stream.

Specified by:
writeException in interface JRMIMarshaller
Parameters:
ex - the thrown exception.
Throws:
MarshalException - if something goes wrong.

prepare

protected void prepare()
                throws org.objectweb.jonathan.apis.kernel.JonathanException
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException