fr.ocelet.runtime
Interface Role

Package class diagram package Role
All Known Subinterfaces:
Entity
All Known Implementing Classes:
AbstractEntity, Model

public interface Role

Generic representation of a Role in Ocelet's relations.


Method Summary
<T> T
getProperty(java.lang.String pname)
          Property getter.
<T> void
setProperty(java.lang.String pname, AffectOperator<T> ao, T val)
          The behavior of this property setter is different if the transaction is true or false.
<T> void
setProperty(java.lang.String pname, T val)
          The behavior of this property setter is different if the transaction is true or false.
 void tabort()
          Ends a transaction aborting any property change.
 void tbegin()
          Begins a transaction for this entity.
 void tcommit()
          Ends a transaction for this entity.
 

Method Detail

getProperty

<T> T getProperty(java.lang.String pname)
Property getter. The returned value is the last valid state of the property. It means that if new values have been assigned to that property but the transaction has not been yet committed, the value returned is the state before assigning those new values.

Parameters:
pname - Name of the property to get.
Returns:
The value corresponding to the last valid state of that property.

setProperty

<T> void setProperty(java.lang.String pname,
                     T val)
The behavior of this property setter is different if the transaction is true or false. If transaction is false, the property is directly set to val. If transaction is true, val is added to the property's list of new value candidates and that list will be later processed, at the end of the transaction. Note that when the transaction end, an AffectOperator will be used to compute the new values candidate list. If no AffectOperator has been given to the property, the Any is the default affectation operator that will be used.

Parameters:
pname - Name of the property
val - Candidate new value for the property.

setProperty

<T> void setProperty(java.lang.String pname,
                     AffectOperator<T> ao,
                     T val)
The behavior of this property setter is different if the transaction is true or false. If transaction is false, the property is directly set to val. If transaction is true, val is added to the property's list of new value candidates and that list will be later processed, at the end of the transaction. This method should only be called when transaction is true

Parameters:
pname - Name of the property
ao - The affectation operator Class to be applied when the transaction will end.
val - Candidate new value for the property.

tbegin

void tbegin()
Begins a transaction for this entity. Any call to setProperty will just add the new values given to a new value candidate list and the new state of the property will not be update until we get a call to tcommit().


tcommit

void tcommit()
Ends a transaction for this entity. All it's properties are assigned their new values of any has been assigned during the transaction. It means that the entity officially switches from state n to state n+1.


tabort

void tabort()
Ends a transaction aborting any property change. All values assigned to any property since the last tbegin() are lost.