Class COM.ibm.jaws.services.filepobc.FilepoEDStream
All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.jaws.services.filepobc.FilepoEDStream
java.lang.Object
|
+----COM.ibm.jaws.services.filepobc.FilepoEDStream
- public class FilepoEDStream
- extends Object
- implements InputEDStream, OutputEDStream
This stream is used by FilepoBC as the interface to
a file wrappered as a combination of the InputEDStream,
OutputEDStream, RandomAccessFile the methods defined
here. It is replaceable provided that all of these interfaces
are supported.
Each Managed object has a separate file whose name is the key.
The format within the file is
- Manageable interface name (a String)
- EssentialData (sequence of atomic types, Strings, Objects and Managed)
- array of begin-end pairs - 1 per sequence - can be nested
o begin-end type (boolean) true==>begin, false==>end
o file offset of the beginning or end of the sequence (int)
- file offset of the array of begin-end pairs (int)
-
FilepoEDStream(File, int, String, BaseCollection)
- Constructs a new FilepoEDStream for each internalize or externalize.
-
atEnd()
-
-
close()
-
-
closeAfterExternalize()
-
FilepoBC calls this after calling externalizeToStream().
-
closeAfterInternalize()
- FilepoBC calls this after calling internalizeFromStream().
-
finalize()
- Code to perform when this object is garbage collected.
-
readBegin()
-
-
readBoolean()
-
-
readByte()
-
-
readChar()
-
-
readDouble()
-
-
readEnd()
-
-
readFloat()
-
-
readInt()
-
-
readLong()
-
-
readManageable()
-
Implementation of InputEDStream.readManageable() method.
-
readManageableWithoutTypeTag()
-
-
readManaged(BaseCollection)
-
This default implementation reads only the Identifier of
the Managed object relative to the specified BC.
-
readManagedWithoutTypeTagWithoutState(BaseCollection)
-
-
readObject()
-
This methods supports reading of any type of object.
-
readShort()
-
-
readString()
-
-
readStringWithoutTypeTag()
-
-
writeBegin()
-
-
writeBoolean(boolean)
-
-
writeByte(byte)
-
-
writeChar(char)
-
-
writeDouble(double)
-
-
writeEnd()
-
-
writeFloat(float)
-
-
writeInt(int)
-
-
writeLong(long)
-
-
writeManageable(Manageable)
-
Implementation of OutputEDStream.writeManageable() method.
-
writeManaged(BaseCollection, Managed)
-
This default implementation stores the Identifier of the Managed
object relative to the specified BC.
-
writeObject(Object)
-
This methods supports writing of any object.
-
writeShort(short)
-
-
writeString(String)
-
FilepoEDStream
public FilepoEDStream(File inFile,
int purpose,
String inManagedSuffix,
BaseCollection relativeToBC) throws FilepoIOException, EDStreamFormatError
- Constructs a new FilepoEDStream for each internalize or externalize.
This assumes that a Java.io.File object has been created.
- Parameters:
- inFile - is the File object representing the file used to
store the stream.
- purpose - is an int indicating what the stream is to be used for
where 0 indicates creation, 1 indicates internalize and
2 indicates externalize.
- inManagedSuffix - is the suffix that must be present on any
Managed object's class name that is read or written.
close
public void close()
closeAfterInternalize
public void closeAfterInternalize() throws EDStreamNestingLevelError
- FilepoBC calls this after calling internalizeFromStream().
closeAfterExternalize
public void closeAfterExternalize() throws EDStreamNestingLevelError
- FilepoBC calls this after calling externalizeToStream().
finalize
public void finalize()
- Code to perform when this object is garbage collected.
- Overrides:
- finalize in class Object
readBoolean
public boolean readBoolean()
writeBoolean
public void writeBoolean(boolean value)
readByte
public byte readByte()
writeByte
public void writeByte(byte value)
readShort
public short readShort()
writeShort
public void writeShort(short value)
readInt
public int readInt()
writeInt
public void writeInt(int value)
readLong
public long readLong()
writeLong
public void writeLong(long value)
readFloat
public float readFloat()
writeFloat
public void writeFloat(float value)
readDouble
public double readDouble()
writeDouble
public void writeDouble(double value)
readChar
public char readChar()
writeChar
public void writeChar(char value)
atEnd
public boolean atEnd()
readBegin
public void readBegin()
readEnd
public void readEnd()
writeBegin
public void writeBegin()
writeEnd
public void writeEnd()
writeObject
public void writeObject(Object value)
- This methods supports writing of any object. There are 5 cases.
First write a char indicating whether null (n), String (s),
Managed (m), or Manageable (v). Support for other Java objects (j)
has been commented out until Java serialization is more widely
available.
For non-Managed objects, this FilepoStream stores the
object's state because it is a persistent stream and non-Managed
object references only work within a single address space.
For a Managed object,
this default implementation stores the Identifier of the Managed
object relative to the specified BC.
First write boolean indicating whether the object is null.
Then store the object's interface name.
Then store the object's Identifier relative to the specified BC.
To also store the Managed object's EssentialData,
subclass this stream.
This option is useful when the state of the Managed object
is kept in the same file as another object's state because
they are frequently used together.
writeString
public void writeString(String value)
writeManaged
public void writeManaged(BaseCollection relativeTo,
Managed managed)
- This default implementation stores the Identifier of the Managed
object relative to the specified BC.
First write boolean indicating whether the object is null.
Then store the object's interface name.
Then store the object's Identifier relative to the specified BC.
To also store the Managed object's EssentialData,
subclass this stream.
This option is useful when the state of the Managed object
is kept in the same file as another object's state because
they are frequently used together.
writeManageable
public void writeManageable(Manageable value)
- Implementation of OutputEDStream.writeManageable() method.
readObject
public Object readObject()
- This methods supports reading of any type of object.
First read a char indicating whether null (n), String (s),
Managed (m), Manageable (v) or other Java object (j).
For a non-Managed object,
this implementation reads both the object's class and
its state, because this is a persistent stream and these
objects do not have an identifier that works outside of
a single address space.
For a Managed object,
this default implementation reads only the Identifier of
the Managed object relative to the specified BC.
First read char object type tag indicating whether the object
is null or Managed.
Then call readManagedWithoutTypeTagWithoutState()
To have this FilepoEDStream also read the Managed object's
EssentialData, subclass this stream.
This option is useful when the state of the Managed object
is kept in the same file as another object's state because
they are frequently used together.
readManaged
public Managed readManaged(BaseCollection relativeTo)
- This default implementation reads only the Identifier of
the Managed object relative to the specified BC.
First read char object type tag indicating whether the object
is null or Managed.
Next read the Managed object's interface name.
Next read the Managed object's persistent Identifier.
Next call resolve on the relativeTo BC to get Managed object.
To have this FilepoEDStream also read the Managed object's
EssentialData, subclass this stream.
This option is useful when the state of the Managed object
is kept in the same file as another object's state because
they are frequently used together.
readManagedWithoutTypeTagWithoutState
protected Managed readManagedWithoutTypeTagWithoutState(BaseCollection relativeTo)
readManageable
public Manageable readManageable()
- Implementation of InputEDStream.readManageable() method.
readManageableWithoutTypeTag
protected Manageable readManageableWithoutTypeTag()
readString
public String readString()
readStringWithoutTypeTag
protected String readStringWithoutTypeTag()
All Packages Class Hierarchy This Package Previous Next Index