Search in sources :

Example 1 with TwoPhaseHLS

use of com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS 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 2 with TwoPhaseHLS

use of com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS 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)2 ProtocolNotRegisteredException (com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException)2 TwoPhaseHLS (com.arjuna.mw.wscf.model.twophase.hls.TwoPhaseHLS)2