use of org.jgroups.util.LazyThreadFactory in project geode by apache.
the class Transport method init.
/*
* (non-Javadoc) JGroups does not currently (3.6.6) allow you to specify that threads should be
* daemon, so we override the init() method here and create the factories before initializing UDP
*
* @see org.jgroups.protocols.UDP#init()
*/
@Override
public void init() throws Exception {
global_thread_factory = new DefaultThreadFactory("Geode ", true);
timer_thread_factory = new LazyThreadFactory(THREAD_POOL_NAME_PREFIX + " Timer", true, true);
default_thread_factory = new DefaultThreadFactory(THREAD_POOL_NAME_PREFIX + " Incoming", true, true);
oob_thread_factory = new DefaultThreadFactory(THREAD_POOL_NAME_PREFIX + " OOB", true, true);
internal_thread_factory = new DefaultThreadFactory(THREAD_POOL_NAME_PREFIX + " INT", true, true);
super.init();
}
use of org.jgroups.util.LazyThreadFactory in project wildfly by wildfly.
the class TransportConfigurator method afterCreation.
@Override
public void afterCreation(Protocol protocol) throws Exception {
if (protocol instanceof TP) {
TP transport = (TP) protocol;
ClassLoader loader = JChannelFactory.class.getClassLoader();
transport.setThreadFactory(new ClassLoaderThreadFactory(new DefaultThreadFactory("", false), loader));
transport.setTimerThreadFactory(new ClassLoaderThreadFactory(new LazyThreadFactory("Timer", true, true), loader));
transport.setDefaultThreadPoolThreadFactory(new ClassLoaderThreadFactory(new DefaultThreadFactory("Incoming", false, true), loader));
transport.setOOBThreadPoolThreadFactory(new ClassLoaderThreadFactory(new DefaultThreadFactory("OOB", false, true), loader));
transport.setInternalThreadPoolThreadFactory(new ClassLoaderThreadFactory(new DefaultThreadFactory("INT", false, true), loader));
}
}
use of org.jgroups.util.LazyThreadFactory in project wildfly by wildfly.
the class TimerFactoryBuilder method build.
@Override
public ServiceBuilder<TimerFactory> build(ServiceTarget target) {
ThreadFactory threadFactory = new ClassLoaderThreadFactory(new LazyThreadFactory(this.getThreadGroupPrefix(), true, true), JChannelFactory.class.getClassLoader());
TimerFactory factory = () -> new TimeScheduler3(threadFactory, this.getMinThreads(), this.getMaxThreads(), this.getKeepAliveTime(), this.getQueueLength(), "abort");
return target.addService(this.getServiceName(), new ValueService<>(new ImmediateValue<>(factory)));
}
Aggregations