Search in sources :

Example 1 with XTSInitialisation

use of org.jboss.jbossts.xts.initialisation.XTSInitialisation in project narayana by jbosstm.

the class XTSService method stop.

public void stop() throws Exception {
    XTSLogger.logger.info("JBossTS XTS Transaction Service - stopping");
    // com.arjuna.services.framework.admin.TaskManagerInitialisation
    TaskManager.getManager().shutdown();
    // shutdown the activity service reaper
    ActivityReaper.shutdown();
    // execute shutdown for all registered initialisations
    Iterator<XTSInitialisation> iterator = xtsInitialisations.iterator();
    while (iterator.hasNext()) {
        XTSInitialisation xtsInitialisation = iterator.next();
        xtsInitialisation.shutdown();
    }
    xtsInitialisations.clear();
}
Also used : XTSInitialisation(org.jboss.jbossts.xts.initialisation.XTSInitialisation)

Example 2 with XTSInitialisation

use of org.jboss.jbossts.xts.initialisation.XTSInitialisation 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

XTSInitialisation (org.jboss.jbossts.xts.initialisation.XTSInitialisation)2 XTSEnvironmentBean (org.jboss.jbossts.xts.environment.XTSEnvironmentBean)1