com.xxl.job.core.thread.JobLogFileCleanThread Java Examples

The following examples show how to use com.xxl.job.core.thread.JobLogFileCleanThread. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XxlJobExecutor.java    From open-capacity-platform with Apache License 2.0 6 votes vote down vote up
public void start() throws Exception {
    // init admin-client
    initAdminBizList(adminAddresses, accessToken);

    // init executor-jobHandlerRepository
    initJobHandlerRepository(applicationContext);

    // init logpath
    XxlJobFileAppender.initLogPath(logPath);

    // init executor-server
    initExecutorServer(port, ip, appName, accessToken);

    // init JobLogFileCleanThread
    JobLogFileCleanThread.getInstance().start(logRetentionDays);
}
 
Example #2
Source File: XxlJobExecutor.java    From microservices-platform with Apache License 2.0 6 votes vote down vote up
public void start() throws Exception {

        // init logpath
        XxlJobFileAppender.initLogPath(logPath);

        // init admin-client
        initAdminBizList(adminAddresses, accessToken);


        // init JobLogFileCleanThread
        JobLogFileCleanThread.getInstance().start(logRetentionDays);

        // init TriggerCallbackThread
        TriggerCallbackThread.getInstance().start();

        // init executor-server
        port = port>0?port: NetUtil.findAvailablePort(9777);
        ip = (ip!=null&&ip.trim().length()>0)?ip: IpUtil.getIp();
        initRpcProvider(ip, port, appName, accessToken);
    }
 
Example #3
Source File: XxlJobExecutor.java    From microservices-platform with Apache License 2.0 6 votes vote down vote up
public void destroy(){
    // destory jobThreadRepository
    if (jobThreadRepository.size() > 0) {
        for (Map.Entry<Integer, JobThread> item: jobThreadRepository.entrySet()) {
            removeJobThread(item.getKey(), "web container destroy and kill the job.");
        }
        jobThreadRepository.clear();
    }


    // destory JobLogFileCleanThread
    JobLogFileCleanThread.getInstance().toStop();

    // destory TriggerCallbackThread
    TriggerCallbackThread.getInstance().toStop();

    // destory executor-server
    stopRpcProvider();
}
 
Example #4
Source File: XxlJobExecutor.java    From zuihou-admin-boot with Apache License 2.0 6 votes vote down vote up
public void start() throws Exception {

        // init logpath
        XxlJobFileAppender.initLogPath(logPath);

        // init admin-client
        initAdminBizList(adminAddresses, accessToken);


        // init JobLogFileCleanThread
        JobLogFileCleanThread.getInstance().start(logRetentionDays);

        // init TriggerCallbackThread
        TriggerCallbackThread.getInstance().start();

        // init executor-server
        port = port > 0 ? port : NetUtil.findAvailablePort(9999);
        ip = (ip != null && ip.trim().length() > 0) ? ip : IpUtil.getIp();
        initRpcProvider(ip, port, appName, accessToken, registryLazy);
    }
 
Example #5
Source File: XxlJobExecutor.java    From zuihou-admin-boot with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    // destory jobThreadRepository
    if (jobThreadRepository.size() > 0) {
        for (Map.Entry<Integer, JobThread> item : jobThreadRepository.entrySet()) {
            removeJobThread(item.getKey(), "web container destroy and kill the job.");
        }
        jobThreadRepository.clear();
    }


    // destory JobLogFileCleanThread
    JobLogFileCleanThread.getInstance().toStop();

    // destory TriggerCallbackThread
    TriggerCallbackThread.getInstance().toStop();

    // destory executor-server
    stopRpcProvider();
}
 
Example #6
Source File: XxlJobExecutor.java    From zuihou-admin-cloud with Apache License 2.0 6 votes vote down vote up
public void start() throws Exception {

        // init logpath
        XxlJobFileAppender.initLogPath(logPath);

        // init admin-client
        initAdminBizList(adminAddresses, accessToken);


        // init JobLogFileCleanThread
        JobLogFileCleanThread.getInstance().start(logRetentionDays);

        // init TriggerCallbackThread
        TriggerCallbackThread.getInstance().start();

        // init executor-server
        port = port > 0 ? port : NetUtil.findAvailablePort(9999);
        ip = (ip != null && ip.trim().length() > 0) ? ip : IpUtil.getIp();
        initRpcProvider(ip, port, appName, accessToken, registryLazy);
    }
 
Example #7
Source File: XxlJobExecutor.java    From zuihou-admin-cloud with Apache License 2.0 6 votes vote down vote up
public void destroy() {
    // destory jobThreadRepository
    if (jobThreadRepository.size() > 0) {
        for (Map.Entry<Integer, JobThread> item : jobThreadRepository.entrySet()) {
            removeJobThread(item.getKey(), "web container destroy and kill the job.");
        }
        jobThreadRepository.clear();
    }


    // destory JobLogFileCleanThread
    JobLogFileCleanThread.getInstance().toStop();

    // destory TriggerCallbackThread
    TriggerCallbackThread.getInstance().toStop();

    // destory executor-server
    stopRpcProvider();
}
 
Example #8
Source File: XxlJobExecutor.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
public void destroy(){
    // destory JobThreadRepository
    if (JobThreadRepository.size() > 0) {
        for (Map.Entry<Integer, JobThread> item: JobThreadRepository.entrySet()) {
            removeJobThread(item.getKey(), "Web容器销毁终止");
        }
        JobThreadRepository.clear();
    }

    // destory executor-server
    stopExecutorServer();

    // destory JobLogFileCleanThread
    JobLogFileCleanThread.getInstance().toStop();
}
 
Example #9
Source File: XxlJobExecutor.java    From xxl-job with GNU General Public License v3.0 5 votes vote down vote up
public void destroy(){
    // destory executor-server
    stopEmbedServer();

    // destory jobThreadRepository
    if (jobThreadRepository.size() > 0) {
        for (Map.Entry<Integer, JobThread> item: jobThreadRepository.entrySet()) {
            JobThread oldJobThread = removeJobThread(item.getKey(), "web container destroy and kill the job.");
            // wait for job thread push result to callback queue
            if (oldJobThread != null) {
                try {
                    oldJobThread.join();
                } catch (InterruptedException e) {
                    logger.error(">>>>>>>>>>> xxl-job, JobThread destroy(join) error, jobId:{}", item.getKey(), e);
                }
            }
        }
        jobThreadRepository.clear();
    }
    jobHandlerRepository.clear();


    // destory JobLogFileCleanThread
    JobLogFileCleanThread.getInstance().toStop();

    // destory TriggerCallbackThread
    TriggerCallbackThread.getInstance().toStop();

}
 
Example #10
Source File: XxlJobExecutor.java    From xxl-job with GNU General Public License v3.0 4 votes vote down vote up
public void start() throws Exception {

        // init logpath
        XxlJobFileAppender.initLogPath(logPath);

        // init invoker, admin-client
        initAdminBizList(adminAddresses, accessToken);


        // init JobLogFileCleanThread
        JobLogFileCleanThread.getInstance().start(logRetentionDays);

        // init TriggerCallbackThread
        TriggerCallbackThread.getInstance().start();

        // init executor-server
        initEmbedServer(address, ip, port, appname, accessToken);
    }