use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.
the class RegistrationCoordinator method registerOperation.
private static RegisterResponseType registerOperation(String messageID, final RegistrationPortType port, final RegisterType registerType) throws CannotRegisterException, InvalidProtocolException, InvalidStateException, SoapFault {
final WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
if (!WSCEnvironmentBean.NO_ASYNC_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) {
// using asynchronous request, we have to wait for the response
AsynchronousRegistrationMapper.getInstance().addClientMessage(messageID);
}
RegisterResponseType response;
if (System.getSecurityManager() == null) {
response = port.registerOperation(registerType);
} else {
response = AccessController.doPrivileged(new PrivilegedAction<RegisterResponseType>() {
@Override
public RegisterResponseType run() {
return port.registerOperation(registerType);
}
});
}
if (!WSCEnvironmentBean.NO_ASYNC_REQUEST.equals(wscEnvironmentBean.getUseAsynchronousRequest())) {
// wait until the response arrives
FaultOrResponse res = AsynchronousRegistrationMapper.getInstance().waitForResponse(messageID, wscEnvironmentBean.getAsyncRequestWait());
if (res.isFault()) {
String detail = res.getFault().getFaultstring();
if (res.getFault().getDetail() != null && res.getFault().getDetail().getAny() != null && !res.getFault().getDetail().getAny().isEmpty()) {
detail = res.getFault().getDetail().getAny().get(0).toString();
}
throwException(res.getFault().getFaultcode(), detail, null, res.getFault());
} else if (res.isEmpty()) {
throw new InvalidStateException("No response assigned to messageID " + messageID);
}
response = res.getResponse();
}
return response;
}
use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.
the class ATParticipantInitialisation method contextInitialized.
/**
* The context has been initialized.
* @param servletContextEvent The servlet context event.
*/
public void contextInitialized(final ServletContextEvent servletContextEvent) {
ServletContext context = servletContextEvent.getServletContext();
WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
String bindAddress = wscEnvironmentBean.getBindAddress11();
int bindPort = wscEnvironmentBean.getBindPort11();
String baseURI = "http://" + bindAddress + ":" + bindPort + "/interop11";
final String uri = baseURI + "/ATParticipantService";
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry();
serviceRegistry.registerServiceProvider(ATInteropConstants.SERVICE_PARTICIPANT, uri);
}
use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.
the class ATInitiatorInitialisation method contextInitialized.
/**
* The context has been initialized.
* @param servletContextEvent The servlet context event.
*/
public void contextInitialized(final ServletContextEvent servletContextEvent) {
ServletContext context = servletContextEvent.getServletContext();
WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
String bindAddress = wscEnvironmentBean.getBindAddress11();
int bindPort = wscEnvironmentBean.getBindPort11();
String baseURI = "http://" + bindAddress + ":" + bindPort + "/interop11";
final String uri = baseURI + "/ATInitiatorService";
final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry();
serviceRegistry.registerServiceProvider(ATInteropConstants.SERVICE_INITIATOR, uri);
}
use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.
the class CoordinatorCompletionParticipantInitialisation 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 participantServiceURLPath = wstEnvironmentBean.getParticipantServiceURLPath();
if (participantServiceURLPath == null) {
participantServiceURLPath = "/ws-t11-participant";
}
if (bindAddress == null) {
bindAddress = "localhost";
}
if (bindPort == 0) {
bindPort = 8080;
}
if (secureBindPort == 0) {
secureBindPort = 8443;
}
final String baseUri = "http://" + bindAddress + ":" + bindPort + participantServiceURLPath;
final String uri = baseUri + "/" + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + participantServiceURLPath;
final String secureUri = secureBaseUri + "/" + BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME;
serviceRegistry.registerServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, uri);
serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.COORDINATOR_COMPLETION_PARTICIPANT_SERVICE_NAME, secureUri);
}
use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.
the class ParticipantCompletionParticipantInitialisation 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 participantServiceURLPath = wstEnvironmentBean.getParticipantServiceURLPath();
if (participantServiceURLPath == null) {
participantServiceURLPath = "/ws-t11-participant";
}
if (bindAddress == null) {
bindAddress = "localhost";
}
if (bindPort == 0) {
bindPort = 8080;
}
if (secureBindPort == 0) {
secureBindPort = 8443;
}
final String baseUri = "http://" + bindAddress + ":" + bindPort + participantServiceURLPath;
final String uri = baseUri + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + participantServiceURLPath;
final String secureUri = secureBaseUri + "/" + BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME;
serviceRegistry.registerServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, uri);
serviceRegistry.registerSecureServiceProvider(BusinessActivityConstants.PARTICIPANT_COMPLETION_PARTICIPANT_SERVICE_NAME, secureUri);
}
Aggregations