Code example for ExecutorService

Methods: awaitTermination, shutdown

0
        } 
    } 
 
    private void shutdownExecutor(ExecutorService executor) {
        try { 
            executor.shutdown();
            executor.awaitTermination(5, TimeUnit.SECONDS);
        } catch (Exception ex) {
            logger.warn("interrupted when shutting down executor service.");
        } 
    } 
 
    /** 
     * set the time period of positive database status detection, monitor will 
     * send detecting request in a interval of such time period.<br> 
     *  
     * @param monitorPeriod 
     */ 
    public void setMonitorPeriod(long monitorPeriod) {
        this.monitorPeriod = monitorPeriod;
    }