Interface COM.ibm.jaws.mofw.OutputEDStream
All Packages Class Hierarchy This Package Previous Next Index
Interface COM.ibm.jaws.mofw.OutputEDStream
- public interface OutputEDStream
- extends Object
OutputEDStream is one of the primary mechanisms used
in the object server. OutputEDStreams come in many
subclasses with special constructors, methods, and internal
representations. A OutputEDStream can be very light-weight
(e.g., a sequence of three values) or very complex (e.g., an
iterator over all the Managed objects in a large database).
In OOD terms, an OutputEDStream is the MOFW representation
of a "sink" process and dataflow that accepts data from a "source"
process or dataflow. In this case, the canonical form are the Java
CORBA datatypes.
These methods each throw a EDStreamFormatError. Like
other Java Errors, they do not require the client to
either use the catch/throw mechanism or require a throws
in the implementation of the method.
It is always the responsibility of the client of a
OutputEDStream to know what order to write to the stream.
-
writeBegin()
- Use this method to indicate the beginning of a
variable length sequence.
-
writeBoolean(boolean)
- Use this method to write a boolean to this stream.
-
writeByte(byte)
- Use this method to write a byte to this stream.
-
writeChar(char)
- Use this method to write a char to this stream.
-
writeDouble(double)
- Use this method to write a double to this stream.
-
writeEnd()
- Use this method to indicate the end of a variable length sequence.
-
writeFloat(float)
- Use this method to write a float to this stream.
-
writeInt(int)
- Use this method to write an int to this stream.
-
writeLong(long)
- Use this method to write a long to this stream.
-
writeManageable(Manageable)
-
Use readManageable() and writeManageable() when you want to
write the object's EssentialData and not preserve its identity.
-
writeManaged(BaseCollection, Managed)
- Use writeManaged() and readManaged() when you want identity
to be preserved.
-
writeObject(Object)
- Use readObject() and writeObject() when you want the stream to
handle
- A Managed object as readManaged() and writeManaged().
-
writeShort(short)
- Use this method to write a short to this stream.
-
writeString(String)
- Use this method to write a string to this stream.
writeBegin
public abstract void writeBegin() throws EDStreamFormatError
- Use this method to indicate the beginning of a
variable length sequence. This must be done before a
writeEnd() call can be made.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a sequence begin.
writeEnd
public abstract void writeEnd() throws EDStreamFormatError
- Use this method to indicate the end of a variable length sequence.
This call must follows a writeBegin() call.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream has no corresponding begin marker.
writeBoolean
public abstract void writeBoolean(boolean value) throws EDStreamFormatError
- Use this method to write a boolean to this stream.
- Parameters:
- value - a
boolean
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a boolean.
writeByte
public abstract void writeByte(byte value) throws EDStreamFormatError
- Use this method to write a byte to this stream.
- Parameters:
- value - a
byte
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a byte.
writeShort
public abstract void writeShort(short value) throws EDStreamFormatError
- Use this method to write a short to this stream.
- Parameters:
- value - a
short
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a short.
writeInt
public abstract void writeInt(int value) throws EDStreamFormatError
- Use this method to write an int to this stream.
- Parameters:
- value - a
int
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than an int.
writeLong
public abstract void writeLong(long value) throws EDStreamFormatError
- Use this method to write a long to this stream.
- Parameters:
- value - a
long
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a long.
writeFloat
public abstract void writeFloat(float value) throws EDStreamFormatError
- Use this method to write a float to this stream.
- Parameters:
- value - a
float
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a float.
writeDouble
public abstract void writeDouble(double value) throws EDStreamFormatError
- Use this method to write a double to this stream.
- Parameters:
- value - a
double
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a double.
writeChar
public abstract void writeChar(char value) throws EDStreamFormatError
- Use this method to write a char to this stream.
- Parameters:
- value - a
char
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a char.
writeString
public abstract void writeString(String value) throws EDStreamFormatError
- Use this method to write a string to this stream.
- Parameters:
- value - a
String
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a string.
writeObject
public abstract void writeObject(Object value) throws EDStreamFormatError
- Use readObject() and writeObject() when you want the stream to
handle
- A Managed object as readManaged() and writeManaged().
- A Manageable non-Managed object as readManageable() and
writeManageable().
- A null object.
- Parameters:
- value - a
Object
to write.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than an object
of the type passed in.
writeManageable
public abstract void writeManageable(Manageable value) throws EDStreamFormatError
- Use readManageable() and writeManageable() when you want to
write the object's EssentialData and not preserve its identity.
The following cases are handled:
- A Managed object.
- A Manageable object.
- A null object.
In all cases, a writeManageable() and subsequent readManageable()
will create a new object with the same EssentialData.
- Parameters:
- value - is the
Manageable
object that is written.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than an object
of the type passed in.
writeManaged
public abstract void writeManaged(BaseCollection relativeTo,
Managed value) throws EDStreamFormatError
- Use writeManaged() and readManaged() when you want identity
to be preserved. That is, if the Managed object is
already in memory, then that object is found instead of
creating a new copy. This implies that enough of the object's
Identifier must be included in the stream to ensure
single-copy semantics. Whether the state of the Managed
object is included in the stream, via externalizeToStream()
and internalizeFromStream(), is up to the stream implementation.
This allows (but does not require) multiple objects to be
included in the same stream as performance dictates.
In the following code,
Managed foo, bar;
myStream.writeManaged(foo);
bar = myStream.readManaged();
boolean identical = foo.isIdentical(bar);
the boolean identical is true.
These methods should be contrasted with writeManageable() and
readManageable(), which only preserve equality. In the following
code,
Manageable foo, bar;
myStream.writeManageable(foo);
bar = myStream.readManageable();
boolean identical = foo.isIdentical(bar);
boolean equal = foo.equals(bar);
the boolean identical is false and the boolean equal is true.
This method should support the following types:
- A Managed object.
- A null object.
- Parameters:
- value - a
Managed
to write.
- relativeTo - determines which BaseCollection will be used
to resolve the object. The relativeTo for writeManaged() and
readManaged() should be the same.
- Throws: EDStreamFormatError
- is raised when the
OutputEDStream expects something other than a Managed
object of the type passed in.
All Packages Class Hierarchy This Package Previous Next Index