Code example for ThreadFactoryBuilder

0
  private final String name;
 
  protected InterruptingExecutionThreadService(final String name) {
    this.name = name;
    this.executorService = Executors.newSingleThreadExecutor(
        new ThreadFactoryBuilder().setNameFormat(name + "-%d").build());
  } 
 
  @Override 
  protected String serviceName() {
    return name;
  } 
 
  @Override 
  protected Executor executor() {
    return executorService;
  } 
 
  @Override 
  protected void triggerShutdown() {