/** * fetch the coordination context type stashed in the current BA context implememtation and use it * to construct an instance of the coordination context extension type we need to send down the * wire to the activation coordinator * * @param current the current AT context implememtation * @return an instance of the coordination context extension type */ private CoordinationContext getContext(TxContextImple current) { CoordinationContextType contextType = getContextType(current); CoordinationContext context = new CoordinationContext(); context.setCoordinationType(contextType.getCoordinationType()); context.setExpires(contextType.getExpires()); context.setIdentifier(contextType.getIdentifier()); context.setRegistrationService(contextType.getRegistrationService()); return context; }
/** * Handle the request. * * @param soapMessage The current message context. * @param installSubordinateTx true if a subordinate transaction should be interposed and false if * the handler should just resume the incoming transaction. currently only works for AT * transactions but will eventually be extended to work for BA transactions too. */ protected boolean handleInboundMessage( final SOAPMessage soapMessage, boolean installSubordinateTx) { if (soapMessage != null) { try { final SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope(); final SOAPHeader soapHeader = soapEnvelope.getHeader(); final SOAPHeaderElement soapHeaderElement = getHeaderElement( soapHeader, CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT); if (soapHeaderElement != null) { final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement); final String coordinationType = cc.getCoordinationType(); if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType)) { clearMustUnderstand(soapHeader, soapHeaderElement); TxContext txContext = new TxContextImple(cc); if (installSubordinateTx) { txContext = SubordinateImporter.importContext(cc); } TransactionManagerFactory.transactionManager().resume(txContext); } else if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals( coordinationType)) { // interposition is not yet implemented for business activities clearMustUnderstand(soapHeader, soapHeaderElement); TxContext txContext = new com.arjuna.mwlabs.wst11.ba.context.TxContextImple(cc); if (installSubordinateTx) { txContext = com.arjuna.mwlabs.wst11.ba.SubordinateImporter.importContext(cc); } BusinessActivityManagerFactory.businessActivityManager().resume(txContext); } else { wstxLogger.i18NLogger.warn_mw_wst11_service_JaxHC11P_2( "com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor.handleRequest(MessageContext context)", coordinationType); } } } catch (final Throwable th) { wstxLogger.i18NLogger.warn_mw_wst11_service_JaxHC11P_1( "com.arjuna.mw.wst11.service.JaxBaseHeaderContextProcessor.handleRequest(MessageContext context)", th); } } return true; }