use of com.arjuna.webservices11.ServiceRegistry in project narayana by jbosstm.
the class TerminationParticipantInitialisation method startup.
public static void startup() {
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
String bindAddress = wscEnvironmentBean.getBindAddress11();
int bindPort = wscEnvironmentBean.getBindPort11();
int secureBindPort = wscEnvironmentBean.getBindPortSecure11();
WSTEnvironmentBean wstEnvironmentBean = XTSPropertyManager.getWSTEnvironmentBean();
String clientServiceURLPath = wstEnvironmentBean.getClientServiceURLPath();
if (clientServiceURLPath == null) {
clientServiceURLPath = "/ws-t11-client";
}
if (bindAddress == null) {
bindAddress = "localhost";
}
if (bindPort == 0) {
bindPort = 8080;
}
if (secureBindPort == 0) {
secureBindPort = 8443;
}
final String baseUri = "http://" + bindAddress + ":" + bindPort + clientServiceURLPath;
final String uri = baseUri + "/" + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + clientServiceURLPath;
final String secureUri = secureBaseUri + "/" + ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME;
serviceRegistry.registerServiceProvider(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, uri);
serviceRegistry.registerSecureServiceProvider(ArjunaTX11Constants.TERMINATION_PARTICIPANT_SERVICE_NAME, secureUri);
}
use of com.arjuna.webservices11.ServiceRegistry in project narayana by jbosstm.
the class CompletionCoordinatorInitialisation method startup.
public static void startup() {
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
String bindAddress = wscEnvironmentBean.getBindAddress11();
int bindPort = wscEnvironmentBean.getBindPort11();
int secureBindPort = wscEnvironmentBean.getBindPortSecure11();
WSTEnvironmentBean wstEnvironmentBean = XTSPropertyManager.getWSTEnvironmentBean();
String coordinatorServiceURLPath = wstEnvironmentBean.getCoordinatorServiceURLPath();
if (coordinatorServiceURLPath == null) {
coordinatorServiceURLPath = "/ws-t11-coordinator";
}
if (bindAddress == null) {
bindAddress = "localhost";
}
if (bindPort == 0) {
bindPort = 8080;
}
if (secureBindPort == 0) {
secureBindPort = 8443;
}
final String baseUri = "http://" + bindAddress + ":" + bindPort + coordinatorServiceURLPath;
final String uri = baseUri + "/" + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + coordinatorServiceURLPath;
final String secureUri = secureBaseUri + "/" + AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME;
serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, uri);
serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.COMPLETION_COORDINATOR_SERVICE_NAME, secureUri);
}
use of com.arjuna.webservices11.ServiceRegistry in project narayana by jbosstm.
the class ParticipantCompletionCoordinatorInitialisation method startup.
public static void startup() {
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
String bindAddress = wscEnvironmentBean.getBindAddress11();
int bindPort = wscEnvironmentBean.getBindPort11();
int secureBindPort = wscEnvironmentBean.getBindPortSecure11();
WSTEnvironmentBean wstEnvironmentBean = XTSPropertyManager.getWSTEnvironmentBean();
String coordinatorServiceURLPath = wstEnvironmentBean.getCoordinatorServiceURLPath();
if (coordinatorServiceURLPath == null) {
coordinatorServiceURLPath = "/ws-t11-coordinator";
}
if (bindAddress == null) {
bindAddress = "localhost";
}
if (bindPort == 0) {
bindPort = 8080;
}
if (secureBindPort == 0) {
secureBindPort = 8443;
}
final String baseUri = "http://" + bindAddress + ":" + bindPort + coordinatorServiceURLPath;
final String uri = baseUri + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + coordinatorServiceURLPath;
final String secureUri = secureBaseUri + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME;
serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, uri);
serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_COORDINATOR_SERVICE_NAME, secureUri);
}
use of com.arjuna.webservices11.ServiceRegistry in project narayana by jbosstm.
the class ContextFactoryImple method createBridgedTransaction.
/**
* create a bridged to subordinate WS-BA 1.1 transaction, associate it with the registrar and create and return
* a coordination context for it. n.b. this is a private, behind-the-scenes method for use by the JTA-BA
* transaction bridge code.
* @param expires the timeout for the bridged to BA transaction
* @param isSecure true if the registration cooridnator URL should use a secure address, otherwise false.
* @return a coordination context for the bridged to transaction
*/
public BridgeTxData createBridgedTransaction(final Long expires, final boolean isSecure) {
// we need to create a subordinate transaction and expose it to the bridge layer so it can
// be driven to completion
SubordinateBACoordinator subTx = null;
try {
subTx = (SubordinateBACoordinator) createSubordinate();
} catch (NoActivityException e) {
// will not happen
return null;
} catch (InvalidProtocolException e) {
// will not happen
return null;
} catch (SystemException e) {
// may happen
return null;
}
// ok now create the context
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
final String registrationCoordinatorURI = serviceRegistry.getServiceURI(CoordinationConstants.REGISTRATION_SERVICE_NAME, isSecure);
final CoordinationContext coordinationContext = new CoordinationContext();
coordinationContext.setCoordinationType(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME);
CoordinationContextType.Identifier identifier = new CoordinationContextType.Identifier();
String txId = subTx.get_uid().stringForm();
identifier.setValue("urn:" + txId);
coordinationContext.setIdentifier(identifier);
if (expires != null && expires.longValue() > 0) {
Expires expiresInstance = new Expires();
expiresInstance.setValue(expires);
coordinationContext.setExpires(expiresInstance);
}
W3CEndpointReference registrationCoordinator = getRegistrationCoordinator(registrationCoordinatorURI, txId);
coordinationContext.setRegistrationService(registrationCoordinator);
try {
_theRegistrar.associate(subTx);
} catch (Exception e) {
// will not happen
}
BridgeTxData bridgeTxData = new BridgeTxData();
bridgeTxData.context = coordinationContext;
bridgeTxData.coordinator = subTx;
bridgeTxData.identifier = txId;
return bridgeTxData;
}
use of com.arjuna.webservices11.ServiceRegistry in project narayana by jbosstm.
the class ContextFactoryImple method getParticipant.
private W3CEndpointReference getParticipant(final String id, final boolean isSecure) {
final QName serviceName = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_QNAME;
final QName endpointName = BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_PORT_QNAME;
final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
final String address = serviceRegistry.getServiceURI(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, isSecure);
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder.serviceName(serviceName);
builder.endpointName(endpointName);
builder.address(address);
InstanceIdentifier.setEndpointInstanceIdentifier(builder, id);
return builder.build();
}
Aggregations