class TomcatDtpAdapter extends AbstractWebServerDtpAdapter<Executor> {

    private static final String TP_PREFIX = "tomcatTp";

    @Override
    public void doEnhance(WebServer webServer) {<FILL_FUNCTION_BODY>}

    @Override
    public void refresh(DtpProperties dtpProperties) {
        refresh(executors.get(getTpName()), dtpProperties.getPlatforms(), dtpProperties.getTomcatTp());
    }

    @Override
    protected String getTpPrefix() {
        return TP_PREFIX;
    }

    /**
     * TomcatExecutorAdapter implements ExecutorAdapter, the goal of this class
     * is to be compatible with {@link org.apache.tomcat.util.threads.ThreadPoolExecutor}.
     **/
    private static class TomcatExecutorAdapter implements ExecutorAdapter<Executor> {
        
        private final Executor executor;
        
        TomcatExecutorAdapter(Executor executor) {
            this.executor = executor;
        }
        
        @Override
        public Executor getOriginal() {
            return this.executor;
        }

        public ThreadPoolExecutor getTomcatExecutor() {
            return (ThreadPoolExecutor) this.executor;
        }
        
        @Override
        public int getCorePoolSize() {
            return getTomcatExecutor().getCorePoolSize();
        }
        
        @Override
        public void setCorePoolSize(int corePoolSize) {
            getTomcatExecutor().setCorePoolSize(corePoolSize);
        }
        
        @Override
        public int getMaximumPoolSize() {
            return getTomcatExecutor().getMaximumPoolSize();
        }
        
        @Override
        public void setMaximumPoolSize(int maximumPoolSize) {
            getTomcatExecutor().setMaximumPoolSize(maximumPoolSize);
        }
        
        @Override
        public int getPoolSize() {
            return getTomcatExecutor().getPoolSize();
        }
        
        @Override
        public int getActiveCount() {
            return getTomcatExecutor().getActiveCount();
        }
        
        @Override
        public int getLargestPoolSize() {
            return getTomcatExecutor().getLargestPoolSize();
        }
        
        @Override
        public long getTaskCount() {
            return getTomcatExecutor().getTaskCount();
        }
        
        @Override
        public long getCompletedTaskCount() {
            return getTomcatExecutor().getCompletedTaskCount();
        }
        
        @Override
        public BlockingQueue<Runnable> getQueue() {
            return getTomcatExecutor().getQueue();
        }
    
        @Override
        public String getRejectHandlerType() {
            return ((RejectHandlerAware) getTomcatExecutor()).getRejectHandlerType();
        }
        
        @Override
        public boolean allowsCoreThreadTimeOut() {
            return getTomcatExecutor().allowsCoreThreadTimeOut();
        }
        
        @Override
        public void allowCoreThreadTimeOut(boolean value) {
            getTomcatExecutor().allowCoreThreadTimeOut(value);
        }
        
        @Override
        public long getKeepAliveTime(TimeUnit unit) {
            return getTomcatExecutor().getKeepAliveTime(unit);
        }
        
        @Override
        public void setKeepAliveTime(long time, TimeUnit unit) {
            getTomcatExecutor().setKeepAliveTime(time, unit);
        }

        @Override
        public boolean isShutdown() {
            return getTomcatExecutor().isShutdown();
        }

        @Override
        public boolean isTerminated() {
            return getTomcatExecutor().isTerminated();
        }

        @Override
        public boolean isTerminating() {
            return getTomcatExecutor().isTerminating();
        }

    }
}

        TomcatWebServer tomcatWebServer = (TomcatWebServer) webServer;
        Executor originExecutor = tomcatWebServer.getTomcat().getConnector().getProtocolHandler().getExecutor();
        TomcatExecutorProxy proxy = new TomcatExecutorProxy((ThreadPoolExecutor) originExecutor);
        ProtocolHandler protocolHandler = tomcatWebServer.getTomcat().getConnector().getProtocolHandler();
        if (protocolHandler instanceof AbstractProtocol) {
            // compatible with lower version tomcat
            ((AbstractProtocol<?>) protocolHandler).setExecutor(proxy);
            putAndFinalize(getTpName(), (ExecutorService) originExecutor, new TomcatExecutorAdapter(proxy));
        }
    
<methods>public non-sealed void <init>() ,public void onApplicationEvent(ApplicationEvent) <variables>