Search in sources :

Example 1 with ProtocolNotRegisteredException

use of com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException in project narayana by jbosstm.

the class UserCoordinatorFactory method userCoordinator.

/**
 * Obtain a reference to a coordinator that implements the specified
 * protocol.
 *
 * @param protocol The XML definition of the type of
 * coordination protocol required.
 *
 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
 * protocol is not available.
 *
 * @return the CoordinatorManager implementation to use.
 */
public static UserCoordinator userCoordinator(String protocol) throws ProtocolNotRegisteredException, SystemException {
    try {
        SagasHLS coordHLS;
        synchronized (_implementations) {
            coordHLS = (SagasHLS) _implementations.get(protocol);
            if (coordHLS == null) {
                coordHLS = (SagasHLS) _protocolManager.getProtocolImplementation(protocol);
                _implementations.put(protocol, coordHLS);
            }
            return coordHLS.userCoordinator();
        }
    } catch (ProtocolNotRegisteredException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new SystemException(ex.toString());
    }
}
Also used : SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException) SagasHLS(com.arjuna.mw.wscf.model.sagas.hls.SagasHLS) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)

Example 2 with ProtocolNotRegisteredException

use of com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException in project narayana by jbosstm.

the class UserCoordinatorFactory method userCoordinator.

/**
 * Obtain a reference to a coordinator that implements the specified
 * protocol.
 *
 * @param protocol The XML definition of the type of
 * coordination protocol required.
 *
 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
 * protocol is not available.
 *
 * @return the CoordinatorManager implementation to use.
 */
public static UserCoordinator userCoordinator(String protocol) throws ProtocolNotRegisteredException, SystemException {
    try {
        TwoPhaseHLS coordHLS;
        synchronized (_implementations) {
            coordHLS = (TwoPhaseHLS) _implementations.get(protocol);
            if (coordHLS == null) {
                coordHLS = (TwoPhaseHLS) _protocolManager.getProtocolImplementation(protocol);
                _implementations.put(protocol, coordHLS);
            }
            return coordHLS.userCoordinator();
        }
    } catch (ProtocolNotRegisteredException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new SystemException(ex.toString());
    }
}
Also used : SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException) TwoPhaseHLS(com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)

Example 3 with ProtocolNotRegisteredException

use of com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException in project narayana by jbosstm.

the class CoordinatorManagerFactory method coordinatorManager.

/**
 * Obtain a reference to a coordinator that implements the specified
 * protocol.
 *
 * @param protocol The XML definition of the type of
 * coordination protocol required.
 *
 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
 * protocol is not available.
 *
 * @return the CoordinatorManager implementation to use.
 */
/*
     * Have the type specified in XML. More data may be specified, which
     * can be passed to the implementation in the same way ObjectName was.
     */
public static CoordinatorManager coordinatorManager(String protocol) throws ProtocolNotRegisteredException, SystemException {
    try {
        SagasHLS coordHLS;
        synchronized (_implementations) {
            coordHLS = (SagasHLS) _implementations.get(protocol);
            if (coordHLS == null) {
                coordHLS = (SagasHLS) _protocolManager.getProtocolImplementation(protocol);
                _implementations.put(protocol, coordHLS);
            }
        }
        return coordHLS.coordinatorManager();
    } catch (ProtocolNotRegisteredException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new SystemException(ex.toString());
    }
}
Also used : SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException) SagasHLS(com.arjuna.mw.wscf.model.sagas.hls.SagasHLS) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)

Example 4 with ProtocolNotRegisteredException

use of com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException in project narayana by jbosstm.

the class CoordinatorManagerFactory method coordinatorManager.

/**
 * Obtain a reference to a coordinator that implements the specified
 * protocol.
 *
 * @param protocol The XML definition of the type of
 * coordination protocol required.
 *
 * @exception com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException Thrown if the requested
 * protocol is not available.
 *
 * @return the CoordinatorManager implementation to use.
 */
/*
     * Have the type specified in XML. More data may be specified, which
     * can be passed to the implementation in the same way ObjectName was.
     */
public static CoordinatorManager coordinatorManager(String protocol) throws ProtocolNotRegisteredException, SystemException {
    try {
        TwoPhaseHLS coordHLS;
        synchronized (_implementations) {
            coordHLS = (TwoPhaseHLS) _implementations.get(protocol);
            if (coordHLS == null) {
                coordHLS = (TwoPhaseHLS) _protocolManager.getProtocolImplementation(protocol);
                _implementations.put(protocol, coordHLS);
            }
            return coordHLS.coordinatorManager();
        }
    } catch (ProtocolNotRegisteredException ex) {
        throw ex;
    } catch (Exception ex) {
        throw new SystemException(ex.toString());
    }
}
Also used : SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException) TwoPhaseHLS(com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS) SystemException(com.arjuna.mw.wsas.exceptions.SystemException) ProtocolNotRegisteredException(com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)

Aggregations

SystemException (com.arjuna.mw.wsas.exceptions.SystemException)4 ProtocolNotRegisteredException (com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)4 SagasHLS (com.arjuna.mw.wscf.model.sagas.hls.SagasHLS)2 TwoPhaseHLS (com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS)2