Search in sources :

Example 16 with WSCEnvironmentBean

use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.

the class BAInitiatorInitialisation 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 + "/BAInitiatorService";
    final ServiceRegistry serviceRegistry = ServiceRegistry.getRegistry();
    serviceRegistry.registerServiceProvider(BAInteropConstants.SERVICE_INITIATOR, uri);
}
Also used : WSCEnvironmentBean(org.jboss.jbossts.xts.environment.WSCEnvironmentBean) ServletContext(javax.servlet.ServletContext) ServiceRegistry(com.arjuna.webservices11.ServiceRegistry)

Example 17 with WSCEnvironmentBean

use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project wildfly by wildfly.

the class XTSManagerService method start.

@Override
public synchronized void start(final StartContext context) throws StartException {
    // XTS expects the TCCL to be set to something that will locate the XTS service implementation classes.
    final ClassLoader loader = XTSService.class.getClassLoader();
    WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(loader);
    try {
        ServerConfig serverConfigValue = wsServerConfig.getValue();
        WSCEnvironmentBean wscEnVBean = XTSPropertyManager.getWSCEnvironmentBean();
        if (coordinatorURL != null) {
            wscEnVBean.setCoordinatorURL11(coordinatorURL);
        } else {
            // Defaults to insecure (http) on this server's bind address.
            String defaultCoordinatorUrl = "http://" + serverConfigValue.getWebServiceHost() + ":" + serverConfigValue.getWebServicePort() + "/" + wscEnVBean.getCoordinatorPath11();
            wscEnVBean.setCoordinatorURL11(defaultCoordinatorUrl);
        }
        wscEnVBean.setBindAddress11(serverConfigValue.getWebServiceHost());
        wscEnVBean.setBindPort11(serverConfigValue.getWebServicePort());
        wscEnVBean.setBindPortSecure11(serverConfigValue.getWebServiceSecurePort());
        XTSService service = new XTSService();
        try {
            service.start();
        } catch (Exception e) {
            throw XtsAsLogger.ROOT_LOGGER.xtsServiceFailedToStart();
        }
        xtsService = service;
    } finally {
        WildFlySecurityManager.setCurrentContextClassLoaderPrivileged((ClassLoader) null);
    }
}
Also used : ServerConfig(org.jboss.wsf.spi.management.ServerConfig) WSCEnvironmentBean(org.jboss.jbossts.xts.environment.WSCEnvironmentBean) StartException(org.jboss.msc.service.StartException) XTSService(org.jboss.jbossts.XTSService)

Example 18 with WSCEnvironmentBean

use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.

the class ActivationCoordinatorInitialisation 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();
    String serviceURLPath = wscEnvironmentBean.getServiceURLPath();
    if (serviceURLPath == null) {
        serviceURLPath = "/ws-c11";
    }
    if (bindAddress == null) {
        bindAddress = "localhost";
    }
    if (bindPort == 0) {
        bindPort = 8080;
    }
    if (secureBindPort == 0) {
        secureBindPort = 8443;
    }
    final String baseUri = "http://" + bindAddress + ":" + bindPort + serviceURLPath;
    final String uri = baseUri + "/ActivationService";
    final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + serviceURLPath;
    final String secureUri = secureBaseUri + "/ActivationService";
    serviceRegistry.registerServiceProvider(CoordinationConstants.ACTIVATION_SERVICE_NAME, uri);
    serviceRegistry.registerSecureServiceProvider(CoordinationConstants.ACTIVATION_SERVICE_NAME, secureUri);
}
Also used : WSCEnvironmentBean(org.jboss.jbossts.xts.environment.WSCEnvironmentBean) ServiceRegistry(com.arjuna.webservices11.ServiceRegistry)

Example 19 with WSCEnvironmentBean

use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.

the class RegistrationCoordinatorInitialisation method startup.

/**
 * The context has been initialized.
 * @param servletContextEvent The servlet context event.
 */
public static void startup() {
    // TODO work out how to configure the endpoint name here
    final ServiceRegistry serviceRegistry = PrivilegedServiceRegistryFactory.getInstance().getServiceRegistry();
    WSCEnvironmentBean wscEnvironmentBean = XTSPropertyManager.getWSCEnvironmentBean();
    String bindAddress = wscEnvironmentBean.getBindAddress11();
    int bindPort = wscEnvironmentBean.getBindPort11();
    int secureBindPort = wscEnvironmentBean.getBindPortSecure11();
    String serviceURLPath = wscEnvironmentBean.getServiceURLPath();
    if (serviceURLPath == null) {
        serviceURLPath = "/ws-c11";
    }
    if (bindAddress == null) {
        bindAddress = "localhost";
    }
    if (bindPort == 0) {
        bindPort = 8080;
    }
    if (secureBindPort == 0) {
        secureBindPort = 8443;
    }
    final String baseUri = "http://" + bindAddress + ":" + bindPort + serviceURLPath;
    final String uri = baseUri + "/RegistrationService";
    final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + serviceURLPath;
    final String secureUri = secureBaseUri + "/RegistrationService";
    serviceRegistry.registerServiceProvider(CoordinationConstants.REGISTRATION_SERVICE_NAME, uri);
    serviceRegistry.registerSecureServiceProvider(CoordinationConstants.REGISTRATION_SERVICE_NAME, secureUri);
    ;
}
Also used : WSCEnvironmentBean(org.jboss.jbossts.xts.environment.WSCEnvironmentBean) ServiceRegistry(com.arjuna.webservices11.ServiceRegistry)

Example 20 with WSCEnvironmentBean

use of org.jboss.jbossts.xts.environment.WSCEnvironmentBean in project narayana by jbosstm.

the class CoordinatorInitialisation 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.COORDINATOR_SERVICE_NAME;
    final String secureBaseUri = "https://" + bindAddress + ":" + secureBindPort + coordinatorServiceURLPath;
    final String secureUri = secureBaseUri + "/" + AtomicTransactionConstants.COORDINATOR_SERVICE_NAME;
    serviceRegistry.registerServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, uri);
    serviceRegistry.registerSecureServiceProvider(AtomicTransactionConstants.COORDINATOR_SERVICE_NAME, secureUri);
}
Also used : WSTEnvironmentBean(org.jboss.jbossts.xts.environment.WSTEnvironmentBean) WSCEnvironmentBean(org.jboss.jbossts.xts.environment.WSCEnvironmentBean) ServiceRegistry(com.arjuna.webservices11.ServiceRegistry)

Aggregations

WSCEnvironmentBean (org.jboss.jbossts.xts.environment.WSCEnvironmentBean)27 ServiceRegistry (com.arjuna.webservices11.ServiceRegistry)22 WSTEnvironmentBean (org.jboss.jbossts.xts.environment.WSTEnvironmentBean)12 ServletContext (javax.servlet.ServletContext)6 PrivilegedAction (java.security.PrivilegedAction)1 XTSService (org.jboss.jbossts.XTSService)1 StartException (org.jboss.msc.service.StartException)1 MAP (org.jboss.ws.api.addressing.MAP)1 ServerConfig (org.jboss.wsf.spi.management.ServerConfig)1 RegisterResponseType (org.oasis_open.docs.ws_tx.wscoor._2006._06.RegisterResponseType)1