@Test public void testAclProperties() { properties.put("alfresco.acl.tracker.corePoolSize", "30"); properties.put("alfresco.acl.tracker.maximumPoolSize", "40"); properties.put("alfresco.acl.tracker.keepAliveTime", "200"); poolFactory = new DefaultTrackerPoolFactory(properties, "TheCore", "AclTracker"); tpe = poolFactory.create(); assertEquals(30, tpe.getCorePoolSize()); assertEquals(40, tpe.getMaximumPoolSize()); assertEquals(200, tpe.getKeepAliveTime(TimeUnit.SECONDS)); }
@Override public ThreadPoolExecutor create() { TraceableThreadFactory threadFactory = new TraceableThreadFactory(); threadFactory.setThreadDaemon(threadDaemon); threadFactory.setThreadPriority(threadPriority); if (poolName.length() > 0) { threadFactory.setNamePrefix(poolName); } BlockingQueue<Runnable> workQueue; if (workQueueSize < 0) { workQueue = new LinkedBlockingQueue<Runnable>(); } else { workQueue = new ArrayBlockingQueue<Runnable>(workQueueSize); } ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit.SECONDS, workQueue, threadFactory, rejectedExecutionHandler); return threadPoolExecutor; }
DefaultTrackerPoolFactory implements TrackerPoolFactory { @Override public ThreadPoolExecutor create() { TraceableThreadFactory threadFactory = new TraceableThreadFactory(); threadFactory.setThreadDaemon(threadDaemon); threadFactory.setThreadPriority(threadPriority); if (poolName.length() > 0) { threadFactory.setNamePrefix(poolName); } BlockingQueue<Runnable> workQueue; if (workQueueSize < 0) { workQueue = new LinkedBlockingQueue<Runnable>(); } else { workQueue = new ArrayBlockingQueue<Runnable>(workQueueSize); } ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit.SECONDS, workQueue, threadFactory, rejectedExecutionHandler); return threadPoolExecutor; } }
DefaultTrackerPoolFactory implements TrackerPoolFactory { @Override public ThreadPoolExecutor create() { TraceableThreadFactory threadFactory = new TraceableThreadFactory(); threadFactory.setThreadDaemon(threadDaemon); threadFactory.setThreadPriority(threadPriority); if (poolName.length() > 0) { threadFactory.setNamePrefix(poolName); } BlockingQueue<Runnable> workQueue; if (workQueueSize < 0) { workQueue = new LinkedBlockingQueue<Runnable>(); } else { workQueue = new ArrayBlockingQueue<Runnable>(workQueueSize); } ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit.SECONDS, workQueue, threadFactory, rejectedExecutionHandler); return threadPoolExecutor; } DefaultTrackerPoolFactory(Properties p, String coreName, String trackerName); }
DefaultTrackerPoolFactory implements TrackerPoolFactory { @Override public ThreadPoolExecutor create() { TraceableThreadFactory threadFactory = new TraceableThreadFactory(); threadFactory.setThreadDaemon(threadDaemon); threadFactory.setThreadPriority(threadPriority); if (poolName.length() > 0) { threadFactory.setNamePrefix(poolName); } BlockingQueue<Runnable> workQueue; if (workQueueSize < 0) { workQueue = new LinkedBlockingQueue<Runnable>(); } else { workQueue = new ArrayBlockingQueue<Runnable>(workQueueSize); } ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit.SECONDS, workQueue, threadFactory, rejectedExecutionHandler); return threadPoolExecutor; } DefaultTrackerPoolFactory(Properties p, String coreName, String trackerName); @Override ThreadPoolExecutor create(); }
DefaultTrackerPoolFactory implements TrackerPoolFactory { @Override public ThreadPoolExecutor create() { TraceableThreadFactory threadFactory = new TraceableThreadFactory(); threadFactory.setThreadDaemon(threadDaemon); threadFactory.setThreadPriority(threadPriority); if (poolName.length() > 0) { threadFactory.setNamePrefix(poolName); } BlockingQueue<Runnable> workQueue; if (workQueueSize < 0) { workQueue = new LinkedBlockingQueue<Runnable>(); } else { workQueue = new ArrayBlockingQueue<Runnable>(workQueueSize); } ThreadPoolExecutor threadPoolExecutor = new DynamicallySizedThreadPoolExecutor( corePoolSize, maximumPoolSize, keepAliveTime, TimeUnit.SECONDS, workQueue, threadFactory, rejectedExecutionHandler); return threadPoolExecutor; } DefaultTrackerPoolFactory(Properties p, String coreName, String trackerName); @Override ThreadPoolExecutor create();  }