public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }
public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }
public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }
public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }
public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }
public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }
public static synchronized SharedEventLoopGroup getInstance(Function<ThreadFactory, EventLoopGroup> eventLoopGroupSupplier) { if (instance != null) { ScheduledFuture<?> f = instance.shutdown.getAndSet(null); if (f != null) { f.cancel(false); } } else { instance = new SharedEventLoopGroup(eventLoopGroupSupplier.apply(AccessController.doPrivileged(new PrivilegedAction<ThreadFactory>() { @Override public ThreadFactory run() { return new ActiveMQThreadFactory("ActiveMQ-client-netty-threads", true, ClientSessionFactoryImpl.class.getClassLoader()); } }))); } instance.channelFactoryCount.incrementAndGet(); return instance; }