// subordinate tx for this one or create and install a new one.
final String identifier = cc.getIdentifier().getValue();
TxContext subordinateTxContext = subordinateContextMap.get(identifier);
if (subordinateTxContext == null) {
// create a context for a local coordinator
CoordinationContextType context = null;
try {
context = atContextFactory.create(AtomicTransactionConstants.WSAT_PROTOCOL, 0L, cc);
} catch (InvalidCreateParametersException e) {
// should not happen
}
subordinateTxContext = new TxContextImple(context);
subordinateContextMap.put(identifier, subordinateTxContext);
// register a cleanup callback with the subordinate transactionso that the entry gets removed
// when the transcation commits or rolls back
String subordinateId = context.getIdentifier().getValue().substring(4); // remove "urn:" prefix
SubordinateCoordinator.SubordinateCallback callback = new SubordinateCoordinator.SubordinateCallback() {
public String parentId = identifier;
public void run()
{
subordinateContextMap.remove(parentId);