new PoolExecutorThreadFactory(name + ".internal-", classLoader), properties.getBoolean(TASK_SCHEDULER_REMOVE_ON_CANCEL), new RejectedExecutionHandler() { userExecutor = new ThreadPoolExecutor(executorPoolSize, executorPoolSize, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new PoolExecutorThreadFactory(name + ".user-", classLoader), new RejectedExecutionHandler() { public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
new PoolExecutorThreadFactory(name + ".internal-", classLoader), properties.getBoolean(TASK_SCHEDULER_REMOVE_ON_CANCEL), new RejectedExecutionHandler() { userExecutor = new ThreadPoolExecutor(executorPoolSize, executorPoolSize, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new PoolExecutorThreadFactory(name + ".user-", classLoader), new RejectedExecutionHandler() { public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
private ManagedExecutorService createExecutor(String name, int poolSize, int queueCapacity, ExecutorType type) { ManagedExecutorService executor; if (type == ExecutorType.CACHED) { executor = new CachedExecutorServiceDelegate(nodeEngine, name, cachedExecutorService, poolSize, queueCapacity); } else if (type == ExecutorType.CONCRETE) { ClassLoader classLoader = nodeEngine.getConfigClassLoader(); String hzName = nodeEngine.getHazelcastInstance().getName(); String internalName = name.startsWith("hz:") ? name.substring(BEGIN_INDEX) : name; String threadNamePrefix = createThreadPoolName(hzName, internalName); PoolExecutorThreadFactory threadFactory = new PoolExecutorThreadFactory(threadNamePrefix, classLoader); NamedThreadPoolExecutor pool = new NamedThreadPoolExecutor(name, poolSize, poolSize, KEEP_ALIVE_TIME, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(queueCapacity), threadFactory ); pool.allowCoreThreadTimeOut(true); executor = pool; } else { throw new IllegalArgumentException("Unknown executor type: " + type); } return executor; }
private ManagedExecutorService createExecutor(String name, int poolSize, int queueCapacity, ExecutorType type) { ManagedExecutorService executor; if (type == ExecutorType.CACHED) { executor = new CachedExecutorServiceDelegate(nodeEngine, name, cachedExecutorService, poolSize, queueCapacity); } else if (type == ExecutorType.CONCRETE) { ClassLoader classLoader = nodeEngine.getConfigClassLoader(); String hzName = nodeEngine.getHazelcastInstance().getName(); String internalName = name.startsWith("hz:") ? name.substring(BEGIN_INDEX) : name; String threadNamePrefix = createThreadPoolName(hzName, internalName); PoolExecutorThreadFactory threadFactory = new PoolExecutorThreadFactory(threadNamePrefix, classLoader); NamedThreadPoolExecutor pool = new NamedThreadPoolExecutor(name, poolSize, poolSize, KEEP_ALIVE_TIME, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(queueCapacity), threadFactory ); pool.allowCoreThreadTimeOut(true); executor = pool; } else { throw new IllegalArgumentException("Unknown executor type: " + type); } return executor; }
public LifecycleServiceImpl(HazelcastClientInstanceImpl client) { this.client = client; ClassLoader classLoader = client.getClientConfig().getClassLoader(); executor = Executors.newSingleThreadExecutor( new PoolExecutorThreadFactory(client.getName() + ".lifecycle-", classLoader)); final List<ListenerConfig> listenerConfigs = client.getClientConfig().getListenerConfigs(); if (listenerConfigs != null && !listenerConfigs.isEmpty()) { for (ListenerConfig listenerConfig : listenerConfigs) { EventListener implementation = listenerConfig.getImplementation(); if (implementation == null) { try { implementation = ClassLoaderUtil.newInstance(classLoader, listenerConfig.getClassName()); } catch (Exception e) { getLogger().severe(e); } } if (implementation instanceof LifecycleListener) { addLifecycleListener((LifecycleListener) implementation); } } } buildInfo = BuildInfoProvider.getBuildInfo(); fireLifecycleEvent(STARTING); }
public LifecycleServiceImpl(HazelcastClientInstanceImpl client) { this.client = client; ClassLoader classLoader = client.getClientConfig().getClassLoader(); executor = Executors.newSingleThreadExecutor( new PoolExecutorThreadFactory(client.getName() + ".lifecycle-", classLoader)); final List<ListenerConfig> listenerConfigs = client.getClientConfig().getListenerConfigs(); if (listenerConfigs != null && !listenerConfigs.isEmpty()) { for (ListenerConfig listenerConfig : listenerConfigs) { EventListener implementation = listenerConfig.getImplementation(); if (implementation == null) { try { implementation = ClassLoaderUtil.newInstance(classLoader, listenerConfig.getClassName()); } catch (Exception e) { getLogger().severe(e); } } if (implementation instanceof LifecycleListener) { addLifecycleListener((LifecycleListener) implementation); } } } buildInfo = BuildInfoProvider.getBuildInfo(); fireLifecycleEvent(STARTING); }
ThreadFactory threadFactory = new PoolExecutorThreadFactory(createThreadPoolName(hzName, "cached"), configClassLoader); this.cachedExecutorService = new ThreadPoolExecutor(
ThreadFactory threadFactory = new PoolExecutorThreadFactory(createThreadPoolName(hzName, "cached"), configClassLoader); this.cachedExecutorService = new ThreadPoolExecutor(