Search in sources :

Example 1 with SagasHLS

use of com.arjuna.mw.wscf.model.sagas.hls.SagasHLS 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 SagasHLS

use of com.arjuna.mw.wscf.model.sagas.hls.SagasHLS 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)

Aggregations

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