Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.jbossts.xts.recovery.participant;
 
 
manager allowing XTS participant recovery moduels to be registered at startup and unregistered at shutdown. note that these are the recovery modules which drive XTS participant recovery. if participant recovery is configured then this will include the participant recovery modules which drive calls to application specific recovery modules registered by participant web services.
{
    
the list of XTS recovery modules actually registered with the JBossTS recovery manager
    private static List<XTSRecoveryModulerecoveryModules = new ArrayList<XTSRecoveryModule>();

    
flag to identify if we have already been initialised
    private static boolean initialised = false;
    
initialisation routine which registers all configured XTS recovery modules
    public static void startup()
    {
        if () {
            return;
        }
        RecoveryEnvironmentBean recoveryEnvironmentBean = XTSPropertyManager.getRecoveryEnvironmentBean();
        List<Stringmodules = recoveryEnvironmentBean.getParticipantRecoveryModules();
        Iterator<Stringiterator = modules.iterator();
        while (iterator.hasNext())
        {
            String className = (Stringiterator.next();
            Class<?> clazz = null;
            try {
                clazz = ParticipantRecoveryInitialisation.class.getClassLoader().loadClass(className);
            } catch (ClassNotFoundException cnfe) {
                continue;
            }
            if (!RecoveryModule.class.isAssignableFrom(clazz)) {
                continue;
            }
            
            try {
                XTSRecoveryModule module = (XTSRecoveryModule)clazz.newInstance();
                module.install();
                RecoveryManager.manager().addModule(module);
                .add(module);
            } catch (InstantiationException ie) {
            } catch (IllegalAccessException iae) {
            }
        }
         =  true;
    }

    
shutdown routine which removes all installed recovery modules
    public static void shutdown()
    {
        if (!) {
            return;
        }
        
        Iterator<XTSRecoveryModuleiterator = .iterator();
        while (iterator.hasNext()) {
            XTSRecoveryModule module = iterator.next();
            RecoveryManager.manager().removeModule(moduletrue);
            module.uninstall();
        }
        .clear();
         =  false;
    }
New to GrepCode? Check out our FAQ X