public ThreadReuseExecutor(String name, int maximumPoolSize) { this.maximumPoolSize = maximumPoolSize; this.poolName = name; tpe = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 2, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory("Worker")) { //$NON-NLS-1$ @Override protected void afterExecute(Runnable r, Throwable t) { if (t != null) { LogManager.logError(LogConstants.CTX_RUNTIME, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021)); } } }; }
public ThreadReuseExecutor(String name, int maximumPoolSize) { this.maximumPoolSize = maximumPoolSize; this.poolName = name; tpe = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 2, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory("Worker")) { //$NON-NLS-1$ @Override protected void afterExecute(Runnable r, Throwable t) { if (t != null) { LogManager.logError(LogConstants.CTX_RUNTIME, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021)); } } }; }
public ThreadReuseExecutor(String name, int maximumPoolSize) { this.maximumPoolSize = maximumPoolSize; this.poolName = name; tpe = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 2, TimeUnit.MINUTES, new SynchronousQueue<Runnable>(), new NamedThreadFactory("Worker")) { //$NON-NLS-1$ @Override protected void afterExecute(Runnable r, Throwable t) { if (t != null) { LogManager.logError(LogConstants.CTX_RUNTIME, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021)); } } }; }
public static ExecutorService newFixedThreadPool(int nThreads, int maxQueue, String name) { ThreadPoolExecutor tpe = new ThreadPoolExecutor(nThreads, nThreads, 60L, TimeUnit.SECONDS, maxQueue==0?new SynchronousQueue<Runnable>():new LinkedBlockingQueue<Runnable>(maxQueue), new NamedThreadFactory(name)); tpe.allowCoreThreadTimeOut(true); return tpe; }
public static ExecutorService newFixedThreadPool(int nThreads, int maxQueue, String name) { ThreadPoolExecutor tpe = new ThreadPoolExecutor(nThreads, nThreads, 60L, TimeUnit.SECONDS, maxQueue==0?new SynchronousQueue<Runnable>():new LinkedBlockingQueue<Runnable>(maxQueue), new NamedThreadFactory(name)); tpe.allowCoreThreadTimeOut(true); return tpe; }
NamedThreadFactory nettyPool = new NamedThreadFactory("NIO"); //$NON-NLS-1$ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_TRANSPORT, MessageLevel.DETAIL)) { LogManager.logDetail(LogConstants.CTX_TRANSPORT, "server = " + address.getAddress() + "binding to port:" + address.getPort()); //$NON-NLS-1$ //$NON-NLS-2$
System.setProperty("jboss.node.name", config.getNodeName()==null?"localhost":config.getNodeName()); this.cmr.setProvider(this); this.scheduler = Executors.newScheduledThreadPool(config.getMaxAsyncThreads(), new NamedThreadFactory("Asynch Worker")); //$NON-NLS-1$ this.replicator = config.getObjectReplicator(); this.eventDistributorFactoryService = new EmbeddedEventDistributorFactoryService();