Search in sources :

Example 1 with XTSService

use of org.jboss.jbossts.XTSService 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)

Aggregations

XTSService (org.jboss.jbossts.XTSService)1 WSCEnvironmentBean (org.jboss.jbossts.xts.environment.WSCEnvironmentBean)1 StartException (org.jboss.msc.service.StartException)1 ServerConfig (org.jboss.wsf.spi.management.ServerConfig)1