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)


Constructor Index

 o FilepoEDStream(File, int, String, BaseCollection)
Constructs a new FilepoEDStream for each internalize or externalize.

Method Index

 o atEnd()
 o close()
 o closeAfterExternalize()
FilepoBC calls this after calling externalizeToStream().
 o closeAfterInternalize()
FilepoBC calls this after calling internalizeFromStream().
 o finalize()
Code to perform when this object is garbage collected.
 o readBegin()
 o readBoolean()
 o readByte()
 o readChar()
 o readDouble()
 o readEnd()
 o readFloat()
 o readInt()
 o readLong()
 o readManageable()
Implementation of InputEDStream.readManageable() method.
 o readManageableWithoutTypeTag()
 o readManaged(BaseCollection)
This default implementation reads only the Identifier of the Managed object relative to the specified BC.
 o readManagedWithoutTypeTagWithoutState(BaseCollection)
 o readObject()
This methods supports reading of any type of object.
 o readShort()
 o readString()
 o readStringWithoutTypeTag()
 o writeBegin()
 o writeBoolean(boolean)
 o writeByte(byte)
 o writeChar(char)
 o writeDouble(double)
 o writeEnd()
 o writeFloat(float)
 o writeInt(int)
 o writeLong(long)
 o writeManageable(Manageable)
Implementation of OutputEDStream.writeManageable() method.
 o writeManaged(BaseCollection, Managed)
This default implementation stores the Identifier of the Managed object relative to the specified BC.
 o writeObject(Object)
This methods supports writing of any object.
 o writeShort(short)
 o writeString(String)

Constructors

 o 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.

Methods

 o close
  public void close()
 o closeAfterInternalize
  public void closeAfterInternalize() throws EDStreamNestingLevelError
FilepoBC calls this after calling internalizeFromStream().
 o closeAfterExternalize
  public void closeAfterExternalize() throws EDStreamNestingLevelError
FilepoBC calls this after calling externalizeToStream().
 o finalize
  public void finalize()
Code to perform when this object is garbage collected.
Overrides:
finalize in class Object
 o readBoolean
  public boolean readBoolean()
 o writeBoolean
  public void writeBoolean(boolean value)
 o readByte
  public byte readByte()
 o writeByte
  public void writeByte(byte value)
 o readShort
  public short readShort()
 o writeShort
  public void writeShort(short value)
 o readInt
  public int readInt()
 o writeInt
  public void writeInt(int value)
 o readLong
  public long readLong()
 o writeLong
  public void writeLong(long value)
 o readFloat
  public float readFloat()
 o writeFloat
  public void writeFloat(float value)
 o readDouble
  public double readDouble()
 o writeDouble
  public void writeDouble(double value)
 o readChar
  public char readChar()
 o writeChar
  public void writeChar(char value)
 o atEnd
  public boolean atEnd()
 o readBegin
  public void readBegin()
 o readEnd
  public void readEnd()
 o writeBegin
  public void writeBegin()
 o writeEnd
  public void writeEnd()
 o 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.

 o writeString
  public void writeString(String value)
 o 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.
 o writeManageable
  public void writeManageable(Manageable value)
Implementation of OutputEDStream.writeManageable() method.
 o 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.

 o 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.
 o readManagedWithoutTypeTagWithoutState
  protected Managed readManagedWithoutTypeTagWithoutState(BaseCollection relativeTo)
 o readManageable
  public Manageable readManageable()
Implementation of InputEDStream.readManageable() method.
 o readManageableWithoutTypeTag
  protected Manageable readManageableWithoutTypeTag()
 o readString
  public String readString()
 o readStringWithoutTypeTag
  protected String readStringWithoutTypeTag()

All Packages  Class Hierarchy  This Package  Previous  Next  Index