Code example for ThreadFactoryBuilder

1
    @Deprecated 
    public ExecutorService getExecutorService()
    { 
        if ( service == null )
        { 
            service = Executors.newCachedThreadPool( new ThreadFactoryBuilder().setNameFormat( getDescription().getName() + " Pool Thread #%1$d" )
                    .setThreadFactory( new GroupedThreadFactory( this ) ).build() );
        } 
        return service;
    } 
    // 
}