|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TransactionContainer
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
| 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. |
| Method Detail |
|---|
boolean addBatchContainer(String name,
BatchContainer batchContainer)
name - batchContainer -
Enumeration getBatchContainers()
Enumeration getBatchContainerNames()
BatchContainer getBatchContainer(String name)
name -
Enumeration getAssertions()
boolean setTransactionResults(TransactionResult[] results)
results -
boolean clearAll()
Enumeration getAssertionTargets()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||