Search in sources :

Example 1 with IsolatableServersClassLoader

use of com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader in project narayana by jbosstm.

the class SimpleIsolatedServers method boot.

private void boot(int index) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException, ClassNotFoundException, IllegalArgumentException, CoreEnvironmentBeanException, IOException, NoSuchFieldException {
    ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
    IsolatableServersClassLoader classLoaderForTransactionManager = new IsolatableServersClassLoader(null, SimpleIsolatedServers.class.getPackage().getName(), contextClassLoader);
    IsolatableServersClassLoader classLoader = new IsolatableServersClassLoader(SimpleIsolatedServers.class.getPackage().getName(), null, classLoaderForTransactionManager);
    localServers[index] = (LocalServer) classLoader.loadClass("com.arjuna.ats.jta.distributed.server.impl.ServerImpl").newInstance();
    Thread.currentThread().setContextClassLoader(classLoaderForTransactionManager);
    localServers[index].initialise(lookupProvider, serverNodeNames[index], serverPortOffsets[index], clusterBuddies[index], classLoaderForTransactionManager);
    lookupProvider.bind(index, localServers[index].connectTo());
    Thread.currentThread().setContextClassLoader(contextClassLoader);
}
Also used : IsolatableServersClassLoader(com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader) IsolatableServersClassLoader(com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader)

Aggregations

IsolatableServersClassLoader (com.arjuna.ats.jta.distributed.server.IsolatableServersClassLoader)1