private static ScheduledExecutorService newExecutorService() { return ThreadUtils.newFixedThreadScheduledPool(2, "ChildReaper"); }
private static ScheduledExecutorService newExecutorService() { return ThreadUtils.newSingleThreadScheduledExecutor("Reaper"); } }
/** * @param client the client * @param threadFactory thread factory to use or null for a default */ public ConnectionStateManager(CuratorFramework client, ThreadFactory threadFactory) { this.client = client; if ( threadFactory == null ) { threadFactory = ThreadUtils.newThreadFactory("ConnectionStateManager"); } service = Executors.newSingleThreadExecutor(threadFactory); }
public static ExecutorService newFixedThreadPool(int qty, String processName) { return Executors.newFixedThreadPool(qty, newThreadFactory(processName)); }
public static ScheduledExecutorService newSingleThreadScheduledExecutor(String processName) { return Executors.newSingleThreadScheduledExecutor(newThreadFactory(processName)); }
public static ScheduledExecutorService newFixedThreadScheduledPool(int qty, String processName) { return Executors.newScheduledThreadPool(qty, newThreadFactory(processName)); }
public static ExecutorService newSingleThreadExecutor(String processName) { return Executors.newSingleThreadExecutor(newThreadFactory(processName)); }
private ThreadFactory getThreadFactory(CuratorFrameworkFactory.Builder builder) { ThreadFactory threadFactory = builder.getThreadFactory(); if ( threadFactory == null ) { threadFactory = ThreadUtils.newThreadFactory("CuratorFramework"); } return threadFactory; }