use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class UserBusinessActivityStandaloneImple method close.
public void close() throws TransactionRolledBackException, UnknownTransactionException, SystemException, WrongStateException {
TxContextImple ctx = null;
try {
ctx = (TxContextImple) _ctxManager.suspend();
if (ctx == null) {
throw new WrongStateException();
}
final String id = ctx.identifier();
final W3CEndpointReference terminatorCoordinatorRPC = getTerminationCoordinatorRPC(ctx);
BusinessActivityTerminatorRPCStub terminatorRPCStub = new BusinessActivityTerminatorRPCStub(id, terminatorCoordinatorRPC);
terminatorRPCStub.close();
} catch (SystemException ex) {
throw ex;
} catch (TransactionRolledBackException ex) {
throw ex;
} catch (WrongStateException ex) {
throw ex;
} catch (UnknownTransactionException ex) {
throw ex;
} catch (Exception ex) {
ex.printStackTrace();
throw new SystemException(ex.toString());
} finally {
tidyup();
}
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class InteropUtil method registerParticipant.
/**
* Register the participant in the specified coordination context.
* @param context The coordination context.
* @param participant The participant.
* @param id The participant id.
* @param protocol The sub protocol to register for.
* @return The participant engine.
* @throws Exception for errors.
*/
private static ParticipantEngine registerParticipant(final CoordinationContextType context, final Participant participant, final String id, final String protocol) throws Exception {
final W3CEndpointReference coordinator = RegistrationCoordinator.register(context, MessageId.getMessageId(), getParticipant(id), protocol);
final ParticipantEngine engine = new ParticipantEngine(participant, id, coordinator);
ParticipantProcessor.getProcessor().activateParticipant(engine, id);
return engine;
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class BAInteropUtil method registerParticipantCompletion.
/**
* Register a participant completion participant in the specified coordination context.
* @param context The coordination context.
* @param participant The durable 2PC participant
* @param id The participant id.
* @return The participant engine.
* @throws Exception for errors.
*/
public static ParticipantCompletionParticipantEngine registerParticipantCompletion(final CoordinationContextType context, final BusinessAgreementWithParticipantCompletionParticipant participant, final String id) throws Exception {
final W3CEndpointReference coordinator = RegistrationCoordinator.register(context, MessageId.getMessageId(), getParticipantCompletionParticipant(id), BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, coordinator, participant);
ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id);
return engine;
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class ActivationTest method testRequestWithExpiresWithCurrentContextWithoutExpires.
@Test
public void testRequestWithExpiresWithCurrentContextWithoutExpires() throws Exception {
final String messageId = "testRequestWithExpiresWithCurrentContextWithoutExpires";
final String coordinationType = TestUtil.COORDINATION_TYPE;
final Long expires = new Long(123456L);
final CoordinationContext coordinationContext = new CoordinationContext();
coordinationContext.setCoordinationType(coordinationType);
CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
identifier.setValue(TestUtil.PROTOCOL_IDENTIFIER);
coordinationContext.setIdentifier(identifier);
W3CEndpointReference registrationService = TestUtil11.getRegistrationEndpoint(identifier.getValue());
coordinationContext.setRegistrationService(registrationService);
executeRequestTest(messageId, coordinationType, expires, coordinationContext);
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class ActivationTest method testRequestWithoutExpiresWithCurrentContextWithExpires.
@Test
public void testRequestWithoutExpiresWithCurrentContextWithExpires() throws Exception {
final String messageId = "testRequestWithoutExpiresWithCurrentContextWithExpires";
final String coordinationType = TestUtil.COORDINATION_TYPE;
final Long expires = null;
final CoordinationContext coordinationContext = new CoordinationContext();
coordinationContext.setCoordinationType(coordinationType);
CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
identifier.setValue(TestUtil.PROTOCOL_IDENTIFIER);
coordinationContext.setIdentifier(identifier);
Expires expiresInstance = new Expires();
expiresInstance.setValue(123456L);
coordinationContext.setExpires(expiresInstance);
W3CEndpointReference registrationService = TestUtil11.getRegistrationEndpoint(identifier.getValue());
coordinationContext.setRegistrationService(registrationService);
executeRequestTest(messageId, coordinationType, expires, coordinationContext);
}
Aggregations