org.objectweb.jorm.api
Interface PBinding
- PBindingCtrl
public interface PBinding
The PBinding interface defines the behaviour of binding objects used
in order to control the I/Os between a data store instance and its
associated memory instance.
- R. Basset, P. Dechamboux
void | bind(PName pn) - It assigns a DSI represented by the PName passed as a parameter to this
PBinding.
|
boolean | exist(Object conn) - It verifies if the DSI attached to this binding exists within the DS.
|
PName | export(Object conn) - It creates a new PName for this binding, the binding state
is normally changed to LIFECYCLE_NEWTOWRITE, and the link to a data
store instance if it existed is removed.
|
PName | export(Object conn, Object hints) - It creates a new PName for this binding, the binding state
is normally changed to LIFECYCLE_NEWTOWRITE, and the link to a data
store instance if it existed is removed.
|
PClassMapping | getPClassMapping() - It gives access to the PClassMapping which manages this binding.
|
PName | getPName() - It gives access to the PName, which designate a particular DSI,
associated to this binding.
|
byte | getStatus() - It yields the current status associated with this PBinding.
|
void | init(PClassMapping pcm) - It initialises a PBinding.
|
void | read(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 | read(Object conn, PAccessor pa, Object txctx) - It reads the data store instance designated by the PName of this
binding and transfers each attribute value to the accessor object.
|
void | unbind() - It remove the association between a PName and a PBinding.
|
void | unexport(Object conn) - It prepares this PBinding to remove the data store instance from the
data store.
|
void | write(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.
|
ACTION_BIND
public static final byte ACTION_BIND
- 1
ACTION_EXIST
public static final byte ACTION_EXIST
- 5
ACTION_EXPORT
public static final byte ACTION_EXPORT
- 3
ACTION_READ
public static final byte ACTION_READ
- 6
ACTION_UNBIND
public static final byte ACTION_UNBIND
- 2
ACTION_UNEXPORT
public static final byte ACTION_UNEXPORT
- 4
ACTION_WRITE
public static final byte ACTION_WRITE
- 7
LIFECYCLE_ACTIVEFORIO
public static final byte LIFECYCLE_ACTIVEFORIO
The PBinding can perform read and write to the data store:
It has a PName to reach an existing data store instance.
- 1
LIFECYCLE_DELTOWRITE
public static final byte LIFECYCLE_DELTOWRITE
On the next write
call, the PBinding will delete
the data store instance associated to its PName, and release
its PName:
It has a PName to reach the related data store instance.
- 2
LIFECYCLE_ERROR
public static final byte LIFECYCLE_ERROR
This is not a real state for a PBinding. It is used when a transition
leads to a protocol error.
- 5
LIFECYCLE_NEWTOWRITE
public static final byte LIFECYCLE_NEWTOWRITE
The PBinding has a PName to reach the data store, but the
corresponding data store instance does not exist yet. It is thus ready
to create the new data store instance.
- 3
LIFECYCLE_NOTBOUND
public static final byte LIFECYCLE_NOTBOUND
The PBinding does not have any PName to reach a data store instance.
- 4
bind
public void bind(PName pn)
throws PException
It assigns a DSI represented by the PName passed as a parameter to this
PBinding. This thus changes the link to the data store instance if one
has been already assigned. The state changed to
LIFECYCLE_ACTIVEFORIO.
pn
- The new PName to associate to this binding. This name
must belong to the binder associated to this binding.
exist
public boolean exist(Object conn)
throws PException
It verifies if the DSI attached to this binding exists within the DS.
conn
- The connection that can be used to refer to the DS.
- It returns true if the DSI exists.
export
public PName export(Object conn)
throws PException
It creates a new PName for this binding, the binding state
is normally changed to LIFECYCLE_NEWTOWRITE, and the link to a data
store instance if it existed is removed.
conn
- The connection that can be used to refer to the DS.
- The new PName assigned to this binding.
export
public PName export(Object conn,
Object hints)
throws PException
It creates a new PName for this binding, the binding state
is normally changed to LIFECYCLE_NEWTOWRITE, and the link to a data
store instance if it existed is removed.
conn
- The connection that can be used to refer to the DS.hints
- Any information relevant for name creation.
- The new PName assigned to this binding.
getPClassMapping
public PClassMapping getPClassMapping()
It gives access to the PClassMapping which manages this binding.
- The PClassMapping which creates this binding.
getPName
public PName getPName()
It gives access to the PName, which designate a particular DSI,
associated to this binding. It returns null
if the binding
has not been given a PName using a bind or export method.
- The PName associated to this binding.
getStatus
public byte getStatus()
It yields the current status associated with this PBinding.
- The corresponding status.
init
public void init(PClassMapping pcm)
throws PException
It initialises a PBinding.
pcm
- The PBinding to initialise.
read
public void read(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.
conn
- The connection that can be used to refer to the DS.pa
- The PAccessor used to access memory variables.
read
public void read(Object conn,
PAccessor pa,
Object txctx)
throws PException
It reads the data store instance designated by the PName of this
binding and transfers each attribute value to the accessor object.
This read method should be used when prefetching is requested.
conn
- The connection that can be used to refer to the DS.pa
- The PAccessor used to access memory variables.txctx
- The transaction context that can be used in case of
prefetching.
unbind
public void unbind()
throws PException
It remove the association between a PName and a PBinding. No more PName
is associated with this binding (it has no more link with a DSI).
unexport
public void unexport(Object conn)
throws PException
It prepares this PBinding to remove the data store instance from the
data store. In order to actually remove this DSI, a call to write must
follow.
conn
- The connection that can be used to refer to the DS.
write
public void write(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.
conn
- The connection that can be used to refer to the DS.pa
- The PAccessor used to access memory variables.