Class horb.orb.FileIOCI
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class horb.orb.FileIOCI

java.lang.Object
   |
   +----horb.orb.IOCICommon
           |
           +----horb.orb.FileIOCI

public final class FileIOCI
extends IOCICommon
implements IOCI
Persistent objects support class. By using this class, you can save and restore objects to/from files. Typical usage is;

 to save:
  FileIOCI file = new FileIOCI("foo.fof");
  file.save(object);
 to restore:
  FileIOCI file = new FileIOCI("foo.fof");
  Object object = file.load();
A file saved by FileIOCI is called a foffile, meaning freezed object file. You can get info of a foffile by 'fofrun -info foo.fof' command.

If a saved object implements the Restartable interface, the object can be executed by the fofrun command. See Restartable for more detail. See examples/foffile for an example. Callable methods in this class are, save(), load(), getFofInfo(), getMajorVersion(), getMinorVersion(), setProperty(), getProperty(), and getLocalHostName().

See Also:

Variable Index

 o is
 o major_version
 o minor_version
 o os
 o signature
0x4830 is the signature of FileIOCI.

Constructor Index

 o FileIOCI()
 o FileIOCI(File)
create FileIOCI for the File.
 o FileIOCI(HorbURL)
create FileIOCI for the URL.
 o FileIOCI(String)
create FileIOCI for the filename.

Method Index

 o available()
return number of bytes available without blocking.
 o connectServer(String, int)
don't call this directly.
 o finalize()
don't call this directly.
 o getAddress()
don't call this directly.
 o getFofInfo()
return information of the fof file.
 o getHostName()
don't call this directly.
 o getLocalAddress()
don't call this directly.
 o getLocalHostName()
returns current local hostname
 o getMajorVersion()
returns major version of this implementation.
 o getMinorVersion()
returns minor version of this implementation.
 o getProperty(int, Object)
get property of FileIOCI.
 o getSignature()
 o isConnected()
don't call this directly.
 o kick()
don't call this directly.
 o load()
load object.
 o recvBoolean()
don't call this directly.
 o recvBooleanArray()
don't call this directly.
 o recvByte()
don't call this directly.
 o recvByteArray()
don't call this directly.
 o recvChar()
don't call this directly.
 o recvCharArray()
don't call this directly.
 o recvConnectServer()
don't cll this directly.
 o recvDouble()
don't call this directly.
 o recvDoubleArray()
don't call this directly.
 o recvFloat()
don't call this directly.
 o recvFloatArray()
don't call this directly.
 o recvInt()
don't call this directly.
 o recvIntArray()
don't call this directly.
 o recvLong()
don't call this directly.
 o recvLongArray()
don't call this directly.
 o recvObject(String, Goldberg)
 o recvShort()
don't call this directly.
 o recvShortArray()
don't call this directly.
 o recvString()
don't call this directly.
 o recvStringArray()
don't call this directly.
 o release()
release connection.
 o save(Object)
save object.
 o sendBoolean(boolean)
don't call this directly.
 o sendBooleanArray(boolean[])
don't call this directly.
 o sendByte(byte)
don't call this directly.
 o sendByteArray(byte[])
don't call this directly.
 o sendChar(char)
don't call this directly.
 o sendCharArray(char[])
don't call this directly.
 o sendDouble(double)
don't call this directly.
 o sendDoubleArray(double[])
don't call this directly.
 o sendFloat(float)
don't call this directly.
 o sendFloatArray(float[])
don't call this directly.
 o sendInt(int)
don't call this directly.
 o sendIntArray(int[])
don't call this directly.
 o sendIOCISignature()
don't call this directly.
 o sendLong(long)
don't call this directly.
 o sendLongArray(long[])
don't call this directly.
 o sendObject(Object, String, Loopy)
 o sendShort(short)
don't call this directly.
 o sendShortArray(short[])
don't call this directly.
 o sendString(String)
don't call this directly.
 o sendStringArray(String[])
don't call this directly.
 o serverAccept(int)
don't call this directly.
 o serverInit(int)
don't call this directly.
 o setProperty(int, Object)
set property of FileIOCI.

Variables

 o major_version
  public final static short major_version
 o minor_version
  public final static short minor_version
 o signature
  public final static short signature
0x4830 is the signature of FileIOCI. Use another signature if you write another IOCI.
 o os
  public DataOutputStream os
 o is
  public DataInputStream is

Constructors

 o FileIOCI
  public FileIOCI()
 o FileIOCI
  public FileIOCI(HorbURL url) throws HORBException
create FileIOCI for the URL.
Parameters:
url - this must be like "file:///filename". If it contains directory, the directory should exists.
 o FileIOCI
  public FileIOCI(File file) throws HORBException
create FileIOCI for the File.
Parameters:
file - File object of the target file.
 o FileIOCI
  public FileIOCI(String filename) throws HORBException
create FileIOCI for the filename.
Parameters:
filename - a platform dependent local filename. If it contains directory, the directory should exists.

Methods

 o save
  public void save(Object o) throws HORBException, IOException
save object. This saves all reachable object from the object into the file.
Parameters:
o - object to be saved.
 o load
  public Object load() throws HORBException, IOException
load object. The object should be saved by the save() method.
Returns:
loaded object.
 o getFofInfo
  public FofInfo getFofInfo() throws HORBException, IOException
return information of the fof file.
 o getSignature
  public short getSignature()
 o getMajorVersion
  public short getMajorVersion()
returns major version of this implementation. If this number differs from a foffile's major version number, this FileIOCI couldn't read the foffile.
 o getMinorVersion
  public short getMinorVersion()
returns minor version of this implementation.
 o setProperty
  public void setProperty(int request,
                          Object obj)
set property of FileIOCI. Currently the common property requests listed in IOCIService are supported.
Overrides:
setProperty in class IOCICommon
 o getProperty
  public Object getProperty(int request,
                            Object obj)
get property of FileIOCI. Currently the common property requests listed in IOCIService are supported.
Overrides:
getProperty in class IOCICommon
 o getLocalHostName
  public String getLocalHostName() throws IOException
returns current local hostname
 o finalize
  public void finalize()
don't call this directly.
Overrides:
finalize in class Object
 o available
  public int available() throws IOException
return number of bytes available without blocking.
 o release
  public void release()
release connection. You don't need to call this.
Overrides:
release in class IOCICommon
 o kick
  public final void kick() throws IOException
don't call this directly.
Overrides:
kick in class IOCICommon
 o sendObject
  public void sendObject(Object o,
                         String expectedClassName,
                         Loopy loopy) throws HORBException, IOException, ProxyException
 o recvObject
  public Object recvObject(String expectedClassName,
                           Goldberg gb) throws HORBException, IOException, ProxyException
 o sendBoolean
  public final void sendBoolean(boolean value) throws IOException
don't call this directly.
 o sendBooleanArray
  public final void sendBooleanArray(boolean value[]) throws IOException
don't call this directly.
 o sendByte
  public final void sendByte(byte value) throws IOException
don't call this directly.
Overrides:
sendByte in class IOCICommon
 o sendByteArray
  public final void sendByteArray(byte value[]) throws IOException
don't call this directly.
 o sendChar
  public final void sendChar(char value) throws IOException
don't call this directly.
 o sendCharArray
  public final void sendCharArray(char value[]) throws IOException
don't call this directly.
 o sendShort
  public final void sendShort(short value) throws IOException
don't call this directly.
Overrides:
sendShort in class IOCICommon
 o sendShortArray
  public final void sendShortArray(short value[]) throws IOException
don't call this directly.
 o sendInt
  public final void sendInt(int value) throws IOException
don't call this directly.
Overrides:
sendInt in class IOCICommon
 o sendIntArray
  public final void sendIntArray(int value[]) throws IOException
don't call this directly.
 o sendLong
  public final void sendLong(long value) throws IOException
don't call this directly.
 o sendLongArray
  public final void sendLongArray(long value[]) throws IOException
don't call this directly.
 o sendFloat
  public final void sendFloat(float value) throws IOException
don't call this directly.
 o sendFloatArray
  public final void sendFloatArray(float value[]) throws IOException
don't call this directly.
 o sendDouble
  public final void sendDouble(double value) throws IOException
don't call this directly.
 o sendDoubleArray
  public final void sendDoubleArray(double value[]) throws IOException
don't call this directly.
 o sendString
  public final void sendString(String value) throws IOException
don't call this directly.
Overrides:
sendString in class IOCICommon
 o sendStringArray
  public final void sendStringArray(String value[]) throws IOException
don't call this directly.
 o recvBoolean
  public final boolean recvBoolean() throws IOException
don't call this directly.
 o recvBooleanArray
  public final boolean[] recvBooleanArray() throws IOException
don't call this directly.
 o recvByte
  public final byte recvByte() throws IOException
don't call this directly.
Overrides:
recvByte in class IOCICommon
 o recvByteArray
  public final byte[] recvByteArray() throws IOException
don't call this directly.
 o recvChar
  public final char recvChar() throws IOException
don't call this directly.
 o recvCharArray
  public final char[] recvCharArray() throws IOException
don't call this directly.
 o recvShort
  public final short recvShort() throws IOException
don't call this directly.
Overrides:
recvShort in class IOCICommon
 o recvShortArray
  public final short[] recvShortArray() throws IOException
don't call this directly.
 o recvInt
  public final int recvInt() throws IOException
don't call this directly.
Overrides:
recvInt in class IOCICommon
 o recvIntArray
  public final int[] recvIntArray() throws IOException
don't call this directly.
 o recvLong
  public final long recvLong() throws IOException
don't call this directly.
 o recvLongArray
  public final long[] recvLongArray() throws IOException
don't call this directly.
 o recvFloat
  public final float recvFloat() throws IOException
don't call this directly.
 o recvFloatArray
  public final float[] recvFloatArray() throws IOException
don't call this directly.
 o recvDouble
  public final double recvDouble() throws IOException
don't call this directly.
 o recvDoubleArray
  public final double[] recvDoubleArray() throws IOException
don't call this directly.
 o recvString
  public final String recvString() throws IOException
don't call this directly.
Overrides:
recvString in class IOCICommon
 o recvStringArray
  public final String[] recvStringArray() throws IOException
don't call this directly.
 o isConnected
  public synchronized boolean isConnected()
don't call this directly.
Overrides:
isConnected in class IOCICommon
 o serverInit
  public void serverInit(int port) throws IOException
don't call this directly.
 o serverAccept
  public IOCI serverAccept(int port) throws IOException
don't call this directly.
 o connectServer
  public void connectServer(String host,
                            int port) throws IOException
don't call this directly.
Overrides:
connectServer in class IOCICommon
 o sendIOCISignature
  public void sendIOCISignature() throws IOException
don't call this directly.
Overrides:
sendIOCISignature in class IOCICommon
 o recvConnectServer
  public boolean recvConnectServer() throws IOException
don't cll this directly.
 o getLocalAddress
  public byte[] getLocalAddress() throws IOException
don't call this directly.
 o getHostName
  public String getHostName()
don't call this directly.
 o getAddress
  public byte[] getAddress()
don't call this directly.

All Packages  Class Hierarchy  This Package  Previous  Next  Index