org.objectweb.jorm.interp.genclass.fos.lib
Class FosGenClassBinding

org.objectweb.jorm.interp.genclass.fos.lib.FosGenClassBinding

public class FosGenClassBinding

author Sebastien Chassande-Barrioz


Constructor Summary
FosGenClassBinding()
          It constructs a FosGenClassBinding.
FosGenClassBinding(GenClassMapping mapping)
          It constructs a FosGenClassBinding for a GC whose elements are GC in turn.
 
Method Summary
 boolean exist(java.lang.Object conn)
          It verifies if the DSI attached to this binding exists within the DS.
 void read(java.lang.Object conn, PAccessor pa)
          It reads the data store instance designated by the PName of this binding and transfers each attribute value to the accessor object.
 void readFile(java.io.ObjectInputStream ois, org.objectweb.perseus.fos.api.FosAccess conn, java.lang.Object ctxt)
          Reads the content of a persistent object from the file represented by the given ObjectInputStream.
 void write(java.lang.Object conn, PAccessor pa)
          It transfers each attribute value taken from the PAccessor object to the data store instance designated by the PName associated with this binding.
 void writeFile(java.io.ObjectOutputStream oos, org.objectweb.perseus.fos.api.FosAccess conn, java.lang.Object ctxt)
          Writes the content of a persistent object to the file represented by the given ObjectOutputStream.
 

Constructor Detail

FosGenClassBinding

public FosGenClassBinding()
It constructs a FosGenClassBinding.

FosGenClassBinding

public FosGenClassBinding(GenClassMapping mapping)
                   throws PExceptionProtocol
It constructs a FosGenClassBinding for a GC whose elements are GC in turn.
Method Detail

exist

public boolean exist(java.lang.Object conn)
              throws PException
It verifies if the DSI attached to this binding exists within the DS.
Parameters:
conn - The connection that can be used to refer to the DS.
Returns:
It returns true if the DSI exists.
Throws:
PExceptionIO - It is raised when a problem occured while accessing to the DS.
PExceptionNaming - It is raised when there is a problem for the associated binder to manage this PName.
PExceptionProtocol - It is raised when it is called with a state different from the following ones: LIFECYCLE_ACTIVEFORIO

read

public void read(java.lang.Object conn,
                 PAccessor pa)
          throws PException
It reads the data store instance designated by the PName of this binding and transfers each attribute value to the accessor object.
Parameters:
conn - The connection that can be used to refer to the DS.
pa - The PAccessor used to access memory variables.
Throws:
PExceptionIO - It is raised when a problem occured while accessing to the DS.
PExceptionNaming - It is raised when there is a problem for the associated binder to manage this PName.
PExceptionProtocol - It is raised when it is called with a state different from the following ones: LIFECYCLE_ACTIVEFORIO

write

public void write(java.lang.Object conn,
                  PAccessor pa)
           throws PException
It transfers each attribute value taken from the PAccessor object to the data store instance designated by the PName associated with this binding.
Parameters:
conn - The connection that can be used to refer to the DS.
pa - The PAccessor used to access memory variables.
Throws:
e1 - if the state of the binding does not allow writing to be completed (no valid name for example) e2 if the pc parameter does not allow acces to the data store
PExceptionIO - It is raised when a problem occured while accessing to the DS.
PExceptionNaming - It is raised when there is a problem for the associated binder to manage this PName.
PExceptionProtocol - It is raised when it is called with a state different from the following ones: LIFECYCLE_ACTIVEFORIO LIFECYCLE_NEWTOWRITE LIFECYCLE_DELTOWRITE
PExceptionTyping - It is raised when a reference to be stored has a type incompatible with the respective field definition.

readFile

public void readFile(java.io.ObjectInputStream ois,
                     org.objectweb.perseus.fos.api.FosAccess conn,
                     java.lang.Object ctxt)
              throws java.lang.Exception
Reads the content of a persistent object from the file represented by the given ObjectInputStream.
Parameters:
ois - The ObjectInputStream representing the file from which to read.
conn - The connection used to access the File Object Store.

writeFile

public void writeFile(java.io.ObjectOutputStream oos,
                      org.objectweb.perseus.fos.api.FosAccess conn,
                      java.lang.Object ctxt)
               throws java.lang.Exception
Writes the content of a persistent object to the file represented by the given ObjectOutputStream.
Parameters:
oos - The ObjectOutputStream representing the file to which to write.
conn - The connection used to access the File Object Store.