Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.arjuna.mwlabs.wst11.ba;
 
class to manage association of incoming BA transactions with subordinate BA transactions coordinated by the local coordination service
public class SubordinateImporter
    private static HashMap<StringTxContextsubordinateContextMap = new HashMap<StringTxContext>();

    
handle on the local 1.1 context factory implementation
    public static TxContext importContext(CoordinationContextType cc)
    {
        // get the subordinate transaction manager to install any existing
        // subordinate tx for this one or create and install a new one.
        final String identifier = cc.getIdentifier().getValue();
        TxContext subordinateTxContext = .get(identifier);
        if (subordinateTxContext == null) {
            // create a context for a local coordinator
            CoordinationContext context = null;
            try {
                context = .create(., 0L, ccfalse);
            } catch (InvalidCreateParametersException e) {
                // should not happen
            }
            subordinateTxContext = new TxContextImple(context);
            .put(identifiersubordinateTxContext);
            // 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
                public String parentId = identifier;
                public void run()
                {
                    .remove();
                }
            };
            SubordinateBACoordinator.addCallback(subordinateIdcallback);
        }
        return subordinateTxContext;
    }
New to GrepCode? Check out our FAQ X