use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class BusinessActivityManagerImple method enlistForBusinessAgreementWithParticipantCompletion.
public BAParticipantManager enlistForBusinessAgreementWithParticipantCompletion(BusinessAgreementWithParticipantCompletionParticipant bap, String id) throws WrongStateException, UnknownTransactionException, SystemException {
final QName service = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_QNAME;
final QName endpoint = BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_PORT_QNAME;
try {
boolean isSecure = ((TxContextImple) currentTransaction()).isSecure();
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
final String address = serviceRegistry.getServiceURI(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, isSecure);
final W3CEndpointReference participant = getParticipant(service, endpoint, address, id);
W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION);
final ParticipantCompletionParticipantEngine engine = new ParticipantCompletionParticipantEngine(id, baPMEndpoint, bap);
ParticipantCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id);
return new BAParticipantCompletionParticipantManagerStub(engine);
} catch (com.arjuna.wsc.InvalidProtocolException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.wsc.InvalidStateException ex) {
throw new WrongStateException();
} catch (com.arjuna.wsc.CannotRegisterException ex) {
throw new UnknownTransactionException();
} catch (Throwable ex) {
ex.printStackTrace();
throw new SystemException(ex.toString());
}
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class BusinessActivityManagerImple method enlistForBusinessAgreementWithCoordinatorCompletion.
public com.arjuna.wst11.BAParticipantManager enlistForBusinessAgreementWithCoordinatorCompletion(BusinessAgreementWithCoordinatorCompletionParticipant bawcp, String id) throws WrongStateException, UnknownTransactionException, SystemException {
final QName service = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME;
final QName endpoint = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME;
boolean isSecure = ((TxContextImple) currentTransaction()).isSecure();
try {
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
final String address = serviceRegistry.getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, isSecure);
final W3CEndpointReference participant = getParticipant(service, endpoint, address, id);
W3CEndpointReference baPMEndpoint = registerParticipant(participant, BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION);
final CoordinatorCompletionParticipantEngine engine = new CoordinatorCompletionParticipantEngine(id, baPMEndpoint, bawcp);
CoordinatorCompletionParticipantProcessor.getProcessor().activateParticipant(engine, id);
return new BACoordinatorCompletionParticipantManagerStub(engine);
} catch (com.arjuna.wsc.InvalidProtocolException ex) {
throw new SystemException(ex.toString());
} catch (com.arjuna.wsc.InvalidStateException ex) {
throw new WrongStateException();
} catch (com.arjuna.wsc.CannotRegisterException ex) {
ex.printStackTrace();
throw new UnknownTransactionException();
} catch (Throwable ex) {
ex.printStackTrace();
throw new SystemException(ex.toString());
}
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class UserBusinessActivityImple method complete.
public void complete() throws UnknownTransactionException, SystemException, WrongStateException {
try {
final TxContextImple ctx = ((TxContextImple) _ctxManager.currentTransaction());
if (ctx == null) {
throw new WrongStateException();
}
final String id = ctx.identifier();
final W3CEndpointReference terminatorCoordinator = getTerminationCoordinator(ctx);
BusinessActivityTerminatorStub terminatorStub = new BusinessActivityTerminatorStub(id, terminatorCoordinator);
terminatorStub.complete();
} catch (SystemException ex) {
throw ex;
} catch (UnknownTransactionException ex) {
throw ex;
} catch (WrongStateException ex) {
throw ex;
} catch (Exception ex) {
throw new SystemException(ex.toString());
}
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class TxContextImple method isSecure.
public boolean isSecure() {
if (valid()) {
CoordinationContextType coordinationContextType = _context.getCoordinationContext();
W3CEndpointReference epref = coordinationContextType.getRegistrationService();
NativeEndpointReference nativeRef = EndpointHelper.transform(NativeEndpointReference.class, epref);
String address = nativeRef.getAddress();
return address.startsWith("https");
}
return false;
}
use of javax.xml.ws.wsaddressing.W3CEndpointReference in project narayana by jbosstm.
the class UserBusinessActivityStandaloneImple method cancel.
public void cancel() throws 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.cancel();
} catch (SystemException 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();
}
}
Aggregations