@Test public void prefixIsAddedToThread() { nexusForkJoinWorkerThreadFactory = new NexusForkJoinWorkerThreadFactory("prefix-test"); ForkJoinPool forkJoinPool = new ForkJoinPool(); ForkJoinWorkerThread thread = nexusForkJoinWorkerThreadFactory.newThread(forkJoinPool); assertThat(thread.getName(), CoreMatchers.containsString("prefix-test")); }
@Override public ForkJoinWorkerThread newThread(final ForkJoinPool pool) { final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool); worker.setName(jobPrefix + worker.getPoolIndex()); return worker; }
NexusForkJoinWorkerThreadFactory implements ForkJoinWorkerThreadFactory { @Override public ForkJoinWorkerThread newThread(final ForkJoinPool pool) { final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool); worker.setName(jobPrefix + worker.getPoolIndex()); return worker; } }
NexusForkJoinWorkerThreadFactory implements ForkJoinWorkerThreadFactory { @Override public ForkJoinWorkerThread newThread(final ForkJoinPool pool) { final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool); worker.setName(jobPrefix + worker.getPoolIndex()); return worker; } NexusForkJoinWorkerThreadFactory(final String jobPrefix); }
NexusForkJoinWorkerThreadFactory implements ForkJoinWorkerThreadFactory { @Override public ForkJoinWorkerThread newThread(final ForkJoinPool pool) { final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool); worker.setName(jobPrefix + worker.getPoolIndex()); return worker; } NexusForkJoinWorkerThreadFactory(final String jobPrefix); @Override ForkJoinWorkerThread newThread(final ForkJoinPool pool); }
NexusForkJoinWorkerThreadFactory implements ForkJoinWorkerThreadFactory { @Override public ForkJoinWorkerThread newThread(final ForkJoinPool pool) { final ForkJoinWorkerThread worker = ForkJoinPool.defaultForkJoinWorkerThreadFactory.newThread(pool); worker.setName(jobPrefix + worker.getPoolIndex()); return worker; } NexusForkJoinWorkerThreadFactory(final String jobPrefix); @Override ForkJoinWorkerThread newThread(final ForkJoinPool pool);  }