/** * create an AT 1.1 subordinate transaction, associate it with the AT 1.1. registry then return a * BridgedTransaction wrapper allowing the transaction to be driven through prepare, commit * and/or rollback and providing access to the transaction id and a context which can be used to * resume the transaction. * @param subordinateType a unique string which groups subordinates for the benefit of their parent * tx/app and allows them to be identified and retrieved as a group during recovery. this must differ * from the string {@link SUBORDINATE_TX_TYPE_AT_AT} * @param expires the timeout for the bridged-to transaction or 0 if no timeout is required * @param isSecure true if AT 1.1. protocol messages for the bridged-to transaction should employ * secure communications, otherwise false * @return a wrapper for the bridged-to transaction * @throws SystemException */ public static BridgeWrapper create(String subordinateType, long expires, boolean isSecure) { // the AT 1.1 context factory provides us with a means to create the required data. ContextFactoryImple.BridgeTxData bridgeTxData = contextFactory.createBridgedTransaction(subordinateType, expires, isSecure); if (bridgeTxData != null) { BridgeWrapper bridgeWrapper = new BridgeWrapper(); bridgeWrapper.context = new TxContextImple(bridgeTxData.context); bridgeWrapper.coordinator = bridgeTxData.coordinator; bridgeWrapper.id = bridgeTxData.identifier; bridgeWrapper.subordinateType = subordinateType; return bridgeWrapper; } else { return null; } }