* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
public class NamingThreadPoolFactory implements ThreadFactory, Closeable {
private final ThreadGroup group;
private final String namePrefix;
private final AtomicLong threadName = new AtomicLong();
public class NamingThreadPoolFactory implements ThreadFactory, Closeable {
private final ThreadGroup group;
private final String namePrefix;
private final AtomicLong threadName = new AtomicLong();
- public NamingThreadPoolFactory(String namePrefix) {
- Preconditions.checkNotNull(namePrefix);
+ public NamingThreadPoolFactory(final String namePrefix) {
+ this.namePrefix = requireNonNull(namePrefix);
return new Thread(group, r, String.format("%s-%d", group.getName(), threadName.incrementAndGet()));
}
@Override
return new Thread(group, r, String.format("%s-%d", group.getName(), threadName.incrementAndGet()));
}
@Override