replscheduler.java

来自「java开源的企业总线.xmlBlaster」· Java 代码 · 共 51 行

JAVA
51
字号
package org.xmlBlaster.contrib.scheduler.jobs;import java.util.logging.Logger;import org.quartz.Job;import org.quartz.JobDataMap;import org.quartz.JobExecutionContext;import org.quartz.JobExecutionException;import org.xmlBlaster.contrib.GlobalInfo;import org.xmlBlaster.contrib.replication.impl.ReplManagerPlugin;import org.xmlBlaster.util.Global;public class ReplScheduler implements Job {   private final static Logger log = Logger.getLogger(ReplScheduler.class.getName());   public ReplScheduler() {         }      public void execute(JobExecutionContext context) throws JobExecutionException {      JobDataMap map = context.getJobDetail().getJobDataMap();      String operation = map.getString("arg0"); // can not be null      String prefix = map.getString("arg1"); // can be null       String dest = map.getString("arg2"); // can be null      Global glob = (Global)map.get(GlobalInfo.ORIGINAL_ENGINE_GLOBAL);      if (glob == null) {         log.severe("Could not find the ServerScope: can not execute the scheduler job");      }      else {         ReplManagerPlugin plugin = (ReplManagerPlugin)glob.getPluginRegistry().getPlugin(ReplManagerPlugin.getPluginName());         if (plugin == null) {            log.severe("Could not find singleton instance of ReplManagerPlugin: can not execute the scheduler job");         }         else {            if ("startDispatcher".equals(operation)) {               plugin.doExecuteSchedulerJob(true, prefix, dest);            }            else if ("stopDispatcher".equals(operation)) {               plugin.doExecuteSchedulerJob(false, prefix, dest);            }            else {               log.warning("Operation '" + operation + "' not recognized: not doing anything");            }         }      }   }      }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?