|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
TransactionContainers are used to link together a group of BatchContainers
which are being used in a single update transaction. TransactionContainers
keep a time ordered record of BatchContainer changes by recording each
BatchContainer change as an Asssertion.
Example client code:
// Create the overall transaction container
TransactionContainer txnCntr = BatchContainerFactory.instantiateTransactionContainer();
// Create a main container.
BatchContainer mainContainer = BatchContainerFactory.instantiateGeneralContainer(
txnCntr, "main" );
// Create a new A object.
RoleAType roleA = RoleAType.newRoleAType();
// Capture the add assertion.
mainContainer.add( roleA );
// Create a role B container.
RoleBatchContainer roleBContainer = BatchContainerFactory.instantiateRoleBatchContainer(
txnCntr, "name", "assocName", "roleB", roleA );
// If roleA object already existed then pre-populate the container.
QueryResult qr = ???.navigate();
roleBContainer.populate( qr );
// Create a role B object.
RoleBType roleB = RoleBType.newRoleBType();
// Assert the existence of the new roleB object.
mainContainer.add( roleB );
// Capture in container.
roleBContainer.add( roleB );
// Make the assertions permanent.
if ( txnCntr.setTransactionResults( ??????.manager.submitTransaction(
txnCntr ) ) )
{
// Loop through for bad assertions.
Enumeration enum = txnCntr.getAssertions();
while ( enum.hasMoreElements() ) {
Assertion nextAssertion = (Assertion) enum.nextElement();
if ( assertion.getException() != null )
// do something...
} // whild
} // if
Supported API: true
Extendable: false
Field Summary | |
static String |
ASSERTIONS
Label for the attribute. |
static String |
BATCH_CONTAINER_MAP
Label for the attribute. |
Method Summary | |
boolean |
addBatchContainer(String name,
BatchContainer batchContainer)
Operation addBatchContainer is used to associate a BatchContainer with the transaction. |
boolean |
clearAll()
Operation clearAll clears each associated BatchContainer and the list of Assertions. |
Enumeration |
getAssertions()
Operation getAssertions returns the Assertions for the transaction. |
Enumeration |
getAssertionTargets()
Return the set of assertion targets. |
BatchContainer |
getBatchContainer(String name)
Operation getBatchContainer returns the BatchContainer for the specified name. |
Enumeration |
getBatchContainerNames()
Operation getBatchContainerNames returns the BatchContainer name keys. |
Enumeration |
getBatchContainers()
Operation getBatchContainers returns all batch containers associated with the transaction. |
boolean |
setTransactionResults(TransactionResult[] results)
Operation setTransactionResults is used to record the results of submitting the assertions to a server. |
Field Detail |
public static final String BATCH_CONTAINER_MAP
public static final String ASSERTIONS
Method Detail |
public boolean addBatchContainer(String name, BatchContainer batchContainer)
name
- batchContainer
-
public Enumeration getBatchContainers()
public Enumeration getBatchContainerNames()
public BatchContainer getBatchContainer(String name)
name
-
public Enumeration getAssertions()
public boolean setTransactionResults(TransactionResult[] results)
results
-
public boolean clearAll()
public Enumeration getAssertionTargets()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |