org.objectweb.jorm.interp.genclass.memory.lib
Class MemoryGenClassBinding

org.objectweb.jorm.interp.genclass.memory.lib.MemoryGenClassBinding
All Implemented Interfaces:
PNameGetter

public class MemoryGenClassBinding
implements PNameGetter

author Sebastien Chassande-Barrioz


Constructor Summary
MemoryGenClassBinding()
           
MemoryGenClassBinding(GenClassMapping mapping)
          It constructs a RdbGenClassBinding.
 
Method Summary
 boolean exist(java.lang.Object conn)
          It verifies if the DSI attached to this binding exists within the DS.
 byte pngetByteField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a byte field.
 char pngetCharField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a char field.
 int pngetIntField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of an int field.
 long pngetLongField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a long field.
 short pngetShortField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a short field.
 java.lang.String pngetStringField(java.lang.String fn, java.lang.Object ctx)
          It retrieves the value of a string field.
 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)
          Reads the content of a persistent object from the file represented by the given ObjectInputStream.
 void readFile(java.io.ObjectInputStream ois, javax.resource.cci.Connection conn)
          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)
          Writes the content of a persistent object to the file represented by the given ObjectOutputStream.
 void writeFile(java.io.ObjectOutputStream oos, javax.resource.cci.Connection conn)
          Writes the content of a persistent object to the file represented by the given ObjectOutputStream.
 
Methods inherited from interface org.objectweb.jorm.naming.api.PNameGetter
pngetDateField, pngetObyteField, pngetOcharField, pngetOintField, pngetOlongField, pngetOshortField
 

Constructor Detail

MemoryGenClassBinding

public MemoryGenClassBinding()

MemoryGenClassBinding

public MemoryGenClassBinding(GenClassMapping mapping)
                      throws PExceptionProtocol
It constructs a RdbGenClassBinding.
Method Detail

exist

public boolean exist(java.lang.Object conn)
              throws PExceptionIO,
                     PExceptionNaming,
                     PExceptionProtocol
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 LIFECYCLE_NOACC

read

public void read(java.lang.Object conn,
                 PAccessor pa)
          throws PExceptionIO,
                 PExceptionNaming,
                 PExceptionProtocol
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.
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 PExceptionIO,
                  PExceptionNaming,
                  PExceptionProtocol,
                  PExceptionTyping
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.
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 LIFECYCLE_DELTOWRITENOACC
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)
              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.

readFile

public void readFile(java.io.ObjectInputStream ois,
                     javax.resource.cci.Connection conn)
              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 repository.

writeFile

public void writeFile(java.io.ObjectOutputStream oos)
               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.

writeFile

public void writeFile(java.io.ObjectOutputStream oos,
                      javax.resource.cci.Connection conn)
               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 repository.

pngetByteField

public byte pngetByteField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PExceptionTyping,
                           PExceptionIO
It retrieves the value of a byte field.
Specified by:
pngetByteField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The byte value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetCharField

public char pngetCharField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PExceptionTyping,
                           PExceptionIO
It retrieves the value of a char field.
Specified by:
pngetCharField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The char value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetShortField

public short pngetShortField(java.lang.String fn,
                             java.lang.Object ctx)
                      throws PExceptionTyping,
                             PExceptionIO
It retrieves the value of a short field.
Specified by:
pngetShortField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The short value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetIntField

public int pngetIntField(java.lang.String fn,
                         java.lang.Object ctx)
                  throws PExceptionTyping,
                         PExceptionIO
It retrieves the value of an int field.
Specified by:
pngetIntField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
context - A context used by PNameGetter to extract the related data.
Returns:
The int value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetLongField

public long pngetLongField(java.lang.String fn,
                           java.lang.Object ctx)
                    throws PExceptionTyping,
                           PExceptionIO
It retrieves the value of a long field.
Specified by:
pngetLongField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
cxt - A context used by PNameGetter to extract the related data.
Returns:
The long value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.

pngetStringField

public java.lang.String pngetStringField(java.lang.String fn,
                                         java.lang.Object ctx)
                                  throws PExceptionTyping,
                                         PExceptionIO
It retrieves the value of a string field.
Specified by:
pngetStringField in interface PNameGetter
Parameters:
fn - A String containing the name of the field.
cxt - A context used by PNameGetter to extract the related data.
Returns:
The java.lang.String value of the field as stored within the composite name.
Throws:
PExceptionTyping - There is no field with this name and this type within this composite name.
PExceptionIO - It is raised when a problem occurs while potentially accessing the DSI.