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());
}
}
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());
}
}
Aggregations