public WSBAHandler(ServiceInvocationMeta serviceInvocationMeta, CompletionType completionType) throws TXFrameworkException { this.serviceInvocationMeta = serviceInvocationMeta; try { BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager(); if (completionType == CompletionType.COORDINATOR) { WSBACoordinatorCompletionParticipant coordinatorCompletionParticipant = new WSBACoordinatorCompletionParticipant(serviceInvocationMeta, new HashMap()); participantManager = businessActivityManager.enlistForBusinessAgreementWithCoordinatorCompletion(coordinatorCompletionParticipant, serviceInvocationMeta.getServiceClass().getName() + UUID.randomUUID()); participant = coordinatorCompletionParticipant; } else { WSBAParticipantCompletionParticipant participantCompletionParticipant = new WSBAParticipantCompletionParticipant(serviceInvocationMeta, new HashMap()); participantManager = businessActivityManager.enlistForBusinessAgreementWithParticipantCompletion(participantCompletionParticipant, serviceInvocationMeta.getServiceClass().getName() + UUID.randomUUID()); participant = participantCompletionParticipant; } } catch (WrongStateException e) { throw new ParticipantRegistrationException("Transaction was not in a state in which participants can be registered", e); } catch (UnknownTransactionException e) { throw new ParticipantRegistrationException("Can't register a participant as the transaction in unknown", e); } catch (SystemException e) { throw new ParticipantRegistrationException("A SystemException occurred when attempting to register a participant", e); } WSBATxControlImpl.resume(participantManager); }