Search in sources :

Example 1 with XTSEnvironmentBean

use of org.jboss.jbossts.xts.environment.XTSEnvironmentBean in project cxf by apache.

the class XTSConfig method xtsService.

@Bean(name = "xtsService", initMethod = "start", destroyMethod = "stop")
public XTSService xtsService() {
    XTSEnvironmentBean xtsEnvironmentBean = XTSPropertyManager.getXTSEnvironmentBean();
    // xtsEnvironmentBean.setXtsInitialisations();
    XTSService service = new XTSService();
    return service;
}
Also used : XTSEnvironmentBean(org.jboss.jbossts.xts.environment.XTSEnvironmentBean) XTSService(org.jboss.jbossts.XTSService) XTSEnvironmentBean(org.jboss.jbossts.xts.environment.XTSEnvironmentBean) Bean(org.springframework.context.annotation.Bean)

Example 2 with XTSEnvironmentBean

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

the class XTSService method start.

public void start() throws Exception {
    XTSLogger.logger.info("JBossTS XTS Transaction Service - starting");
    // execute startup for all registered initialisations
    XTSEnvironmentBean xtsEnvironmentBean = XTSPropertyManager.getXTSEnvironmentBean();
    Iterator<String> iterator = xtsEnvironmentBean.getXtsInitialisations().iterator();
    while (iterator.hasNext()) {
        String className = iterator.next();
        Class<?> clazz = null;
        try {
            clazz = CoordinatorRecoveryInitialisation.class.getClassLoader().loadClass(className);
        } catch (ClassNotFoundException cnfe) {
            XTSLogger.i18NLogger.error_XTSService_1(className, cnfe);
            continue;
        }
        if (!XTSInitialisation.class.isAssignableFrom(clazz)) {
            XTSLogger.i18NLogger.error_XTSService_2(className);
            continue;
        }
        try {
            XTSInitialisation initialisation = (XTSInitialisation) clazz.newInstance();
            initialisation.startup();
            xtsInitialisations.add(initialisation);
        } catch (InstantiationException ie) {
            XTSLogger.i18NLogger.error_XTSService_3(className, ie);
        } catch (IllegalAccessException iae) {
            XTSLogger.i18NLogger.error_XTSService_4(className, iae);
        }
    }
    TaskManagerInitialisation();
}
Also used : XTSInitialisation(org.jboss.jbossts.xts.initialisation.XTSInitialisation) XTSEnvironmentBean(org.jboss.jbossts.xts.environment.XTSEnvironmentBean)

Aggregations

XTSEnvironmentBean (org.jboss.jbossts.xts.environment.XTSEnvironmentBean)2 XTSService (org.jboss.jbossts.XTSService)1 XTSInitialisation (org.jboss.jbossts.xts.initialisation.XTSInitialisation)1 Bean (org.springframework.context.annotation.Bean)1