use of com.arjuna.webservices.SoapFault in project narayana by jbosstm.
the class UserTransactionStandaloneImple method startTransaction.
protected final Context startTransaction(int timeout, TxContextImple current) throws InvalidCreateParametersException, SystemException {
try {
// TODO: tricks for per app _activationCoordinatorService config, perhaps:
// InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
final Long expires = (timeout > 0 ? new Long(timeout) : null);
final String messageId = MessageId.getMessageId();
final CoordinationContext currentContext = (current != null ? getContext(current) : null);
final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(_activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, currentContext);
if (coordinationContext == null) {
throw new SystemException(wstxLogger.i18NLogger.get_mwlabs_wst_at_remote_UserTransaction11Imple__2());
}
return new ContextImple(coordinationContext);
} catch (final InvalidCreateParametersException icpe) {
throw icpe;
} catch (final SoapFault sf) {
throw new SystemException(sf.getMessage());
} catch (final Exception ex) {
throw new SystemException(ex.toString());
}
}
use of com.arjuna.webservices.SoapFault in project narayana by jbosstm.
the class TransactionManagerImple method registerParticipant.
final W3CEndpointReference registerParticipant(final W3CEndpointReference participant, final String protocol) throws InvalidProtocolException, InvalidStateException, CannotRegisterException, SystemException {
TxContextImple currentTx = null;
try {
currentTx = (TxContextImple) _ctxManager.suspend();
if (currentTx == null)
throw new CannotRegisterException();
final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext();
final String messageId = MessageId.getMessageId();
return com.arjuna.wsc11.RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol);
} catch (final SoapFault sf) {
throw new SystemException(sf.getMessage());
} catch (final CannotRegisterException cre) {
throw cre;
} catch (final InvalidStateException ise) {
throw ise;
} catch (final InvalidProtocolException ipe) {
throw ipe;
} catch (final Exception ex) {
throw new SystemException(ex.toString());
} finally {
try {
if (currentTx != null)
_ctxManager.resume(currentTx);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
use of com.arjuna.webservices.SoapFault in project narayana by jbosstm.
the class UserTransactionImple method startTransaction.
protected final Context startTransaction(int timeout, TxContextImple current) throws com.arjuna.wsc.InvalidCreateParametersException, SystemException {
try {
// TODO: tricks for per app _activationCoordinatorService config, perhaps:
// InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
final Long expires = (timeout > 0 ? new Long(timeout) : null);
final String messageId = MessageId.getMessageId();
final CoordinationContext currentContext = (current != null ? getContext(current) : null);
final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(_activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, currentContext);
if (coordinationContext == null) {
throw new SystemException(wstxLogger.i18NLogger.get_mwlabs_wst_at_remote_UserTransaction11Imple__2());
}
return new ContextImple(coordinationContext);
} catch (final InvalidCreateParametersException icpe) {
throw icpe;
} catch (final SoapFault sf) {
throw new SystemException(sf.getMessage());
} catch (final Exception ex) {
throw new SystemException(ex.toString());
}
}
use of com.arjuna.webservices.SoapFault in project narayana by jbosstm.
the class BusinessActivityManagerImple method registerParticipant.
private final W3CEndpointReference registerParticipant(final W3CEndpointReference participant, final String protocol) throws com.arjuna.wsc.InvalidProtocolException, com.arjuna.wsc.InvalidStateException, com.arjuna.wsc.CannotRegisterException, SystemException {
TxContextImple currentTx = null;
try {
currentTx = (TxContextImple) _ctxManager.currentTransaction();
if (currentTx == null)
throw new com.arjuna.wsc.NoActivityException();
final CoordinationContextType coordinationContext = currentTx.context().getCoordinationContext();
final String messageId = MessageId.getMessageId();
return RegistrationCoordinator.register(coordinationContext, messageId, participant, protocol);
} catch (final SoapFault sf) {
throw new SystemException(sf.getMessage());
} catch (CannotRegisterException ex) {
throw ex;
} catch (Exception ex) {
ex.printStackTrace();
throw new SystemException(ex.toString());
} finally {
try {
if (currentTx != null)
_ctxManager.resume(currentTx);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
use of com.arjuna.webservices.SoapFault in project narayana by jbosstm.
the class UserBusinessActivityImple method startTransaction.
private final Context startTransaction(int timeout, TxContextImple current) throws InvalidCreateParametersException, SystemException {
try {
final Long expires = (timeout > 0 ? new Long(timeout) : null);
final String messageId = MessageId.getMessageId();
final CoordinationContext currentContext = (current != null ? getContext(current) : null);
final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(_activationCoordinatorService, messageId, BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, expires, currentContext);
if (coordinationContext == null) {
throw new SystemException(wstxLogger.i18NLogger.get_mwlabs_wst11_ba_remote_UserBusinessActivityImple_2());
}
return new ContextImple(coordinationContext);
} catch (final InvalidCreateParametersException icpe) {
throw icpe;
} catch (final SoapFault sf) {
throw new SystemException(sf.getMessage());
} catch (final Exception ex) {
throw new SystemException(ex.toString());
}
}
Aggregations