亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? remotescheduler.java

?? Java中非常實(shí)用流控制工具
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* 
 * Copyright 2004-2005 OpenSymphony 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 
 * use this file except in compliance with the License. You may obtain a copy 
 * of the License at 
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0 
 *   
 * Unless required by applicable law or agreed to in writing, software 
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
 * License for the specific language governing permissions and limitations 
 * under the License.
 * 
 */

/*
 * Previously Copyright (c) 2001-2004 James House
 */
package org.quartz.impl;

import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.util.Date;
import java.util.List;
import java.util.Set;

import org.quartz.Calendar;
import org.quartz.JobDataMap;
import org.quartz.JobDetail;
import org.quartz.JobListener;
import org.quartz.Scheduler;
import org.quartz.SchedulerContext;
import org.quartz.SchedulerException;
import org.quartz.SchedulerListener;
import org.quartz.SchedulerMetaData;
import org.quartz.Trigger;
import org.quartz.TriggerListener;
import org.quartz.UnableToInterruptJobException;
import org.quartz.core.RemotableQuartzScheduler;
import org.quartz.core.SchedulingContext;
import org.quartz.spi.JobFactory;

/**
 * <p>
 * An implementation of the <code>Scheduler</code> interface that remotely
 * proxies all method calls to the equivalent call on a given <code>QuartzScheduler</code>
 * instance, via RMI.
 * </p>
 * 
 * @see org.quartz.Scheduler
 * @see org.quartz.core.QuartzScheduler
 * @see org.quartz.core.SchedulingContext
 * 
 * @author James House
 */
public class RemoteScheduler implements Scheduler {

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Data members.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    private RemotableQuartzScheduler rsched;

    private SchedulingContext schedCtxt;

    private String schedId;

    private String rmiHost;

    private int rmiPort;

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Constructors.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    /**
     * <p>
     * Construct a <code>RemoteScheduler</code> instance to proxy the given
     * <code>RemoteableQuartzScheduler</code> instance, and with the given
     * <code>SchedulingContext</code>.
     * </p>
     */
    public RemoteScheduler(SchedulingContext schedCtxt, String schedId,
            String host, int port) {

        this.schedCtxt = schedCtxt;
        this.schedId = schedId;
        this.rmiHost = host;
        this.rmiPort = port;
    }

    /*
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     * 
     * Interface.
     * 
     * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     */

    protected RemotableQuartzScheduler getRemoteScheduler()
        throws SchedulerException {
        if (rsched != null) {
            return rsched;
        }

        try {
            Registry registry = LocateRegistry.getRegistry(rmiHost, rmiPort);

            rsched = (RemotableQuartzScheduler) registry.lookup(schedId);

        } catch (Exception e) {
            SchedulerException initException = new SchedulerException(
                    "Could not get handle to remote scheduler: "
                            + e.getMessage(), e);
            initException
                    .setErrorCode(SchedulerException.ERR_COMMUNICATION_FAILURE);
            throw initException;
        }

        return rsched;
    }

    protected SchedulerException invalidateHandleCreateException(String msg,
            Exception cause) {
        rsched = null;
        SchedulerException ex = new SchedulerException(msg, cause);
        ex.setErrorCode(SchedulerException.ERR_COMMUNICATION_FAILURE);
        return ex;
    }

    /**
     * <p>
     * Returns the name of the <code>Scheduler</code>.
     * </p>
     */
    public String getSchedulerName() throws SchedulerException {
        try {
            return getRemoteScheduler().getSchedulerName();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * <p>
     * Returns the instance Id of the <code>Scheduler</code>.
     * </p>
     */
    public String getSchedulerInstanceId() throws SchedulerException {
        try {
            return getRemoteScheduler().getSchedulerInstanceId();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    public SchedulerMetaData getMetaData() throws SchedulerException {
        try {
            RemotableQuartzScheduler sched = getRemoteScheduler();
            return new SchedulerMetaData(getSchedulerName(),
                    getSchedulerInstanceId(), getClass(), true, isStarted(), 
                    isInStandbyMode(), isShutdown(), sched.runningSince(), 
                    sched.numJobsExecuted(), sched.getJobStoreClass(), 
                    sched.supportsPersistence(), sched.getThreadPoolClass(), 
                    sched.getThreadPoolSize(), sched.getVersion());

        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }

    }

    /**
     * <p>
     * Returns the <code>SchedulerContext</code> of the <code>Scheduler</code>.
     * </p>
     */
    public SchedulerContext getContext() throws SchedulerException {
        try {
            return getRemoteScheduler().getSchedulerContext();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    ///////////////////////////////////////////////////////////////////////////
    ///
    /// Schedululer State Management Methods
    ///
    ///////////////////////////////////////////////////////////////////////////

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public void start() throws SchedulerException {
        try {
            getRemoteScheduler().start();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public void startDelayed(int seconds) throws SchedulerException {
        try {
            getRemoteScheduler().startDelayed(seconds);
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }
    
    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public void standby() throws SchedulerException {
        try {
            getRemoteScheduler().standby();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * @see org.quartz.Scheduler#pause()
     * @deprecated
     */
    public void pause() throws SchedulerException {
        this.standby();
    }    
    
    

    /**
     * Whether the scheduler has been started.  
     * 
     * <p>
     * Note: This only reflects whether <code>{@link #start()}</code> has ever
     * been called on this Scheduler, so it will return <code>true</code> even 
     * if the <code>Scheduler</code> is currently in standby mode or has been 
     * since shutdown.
     * </p>
     * 
     * @see #start()
     * @see #isShutdown()
     * @see #isInStandbyMode()
     */    
    public boolean isStarted() throws SchedulerException {
        try {
            return (getRemoteScheduler().runningSince() != null);
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }   
    }
    
    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public boolean isInStandbyMode() throws SchedulerException {
        try {
            return getRemoteScheduler().isInStandbyMode();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    public boolean isPaused() throws SchedulerException {
        return this.isInStandbyMode();
    }
    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public void shutdown() throws SchedulerException {
        try {
            String schedulerName = getSchedulerName();
            
            getRemoteScheduler().shutdown();
            
            SchedulerRepository.getInstance().remove(schedulerName);
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public void shutdown(boolean waitForJobsToComplete)
        throws SchedulerException {
        try {
            String schedulerName = getSchedulerName();
            
            getRemoteScheduler().shutdown(waitForJobsToComplete);

            SchedulerRepository.getInstance().remove(schedulerName);
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public boolean isShutdown() throws SchedulerException {
        try {
            return getRemoteScheduler().isShutdown();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
     * </p>
     */
    public List getCurrentlyExecutingJobs() throws SchedulerException {
        try {
            return getRemoteScheduler().getCurrentlyExecutingJobs();
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    ///////////////////////////////////////////////////////////////////////////
    ///
    /// Scheduling-related Methods
    ///
    ///////////////////////////////////////////////////////////////////////////

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
     * passing the <code>SchedulingContext</code> associated with this
     * instance.
     * </p>
     */
    public Date scheduleJob(JobDetail jobDetail, Trigger trigger)
        throws SchedulerException {
        try {
            return getRemoteScheduler().scheduleJob(schedCtxt, jobDetail,
                    trigger);
        } catch (RemoteException re) {
            throw invalidateHandleCreateException(
                    "Error communicating with remote scheduler.", re);
        }
    }

    /**
     * <p>
     * Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>,
     * passing the <code>SchedulingContext</code> associated with this
     * instance.
     * </p>
     */
    public Date scheduleJob(Trigger trigger) throws SchedulerException {
        try {
            return getRemoteScheduler().scheduleJob(schedCtxt, trigger);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本乱人伦aⅴ精品| 国产精品久久精品日日| 一区二区三区日韩在线观看| 成人一区二区三区| 一区在线观看视频| 在线观看日韩高清av| 五月天婷婷综合| 久久久久成人黄色影片| 精品亚洲porn| 欧美不卡一区二区三区| 视频在线观看91| 欧美精品v日韩精品v韩国精品v| 亚洲男女一区二区三区| 色视频一区二区| 日韩精品欧美精品| 精品国产91久久久久久久妲己| 天天综合色天天综合色h| 日韩欧美一二三| 国产成人一区二区精品非洲| 综合激情成人伊人| 欧美午夜精品久久久| 理论片日本一区| 欧美激情中文不卡| 欧美性感一区二区三区| 精品中文字幕一区二区| 亚洲视频在线观看三级| 91精品国产欧美日韩| 成人av综合在线| 日本成人在线网站| 伊人色综合久久天天人手人婷| 欧美系列日韩一区| 国产suv精品一区二区883| 亚洲欧美欧美一区二区三区| 精品福利在线导航| 欧美三级一区二区| 色婷婷精品久久二区二区蜜臀av| 麻豆成人av在线| 日本不卡一二三区黄网| 亚洲一区二区高清| 亚洲免费观看高清完整版在线观看 | 国产99久久久国产精品潘金| 亚洲一区在线观看免费观看电影高清| 国产视频一区二区在线| 韩国欧美一区二区| 日韩精品一区二区三区视频在线观看| 国产成人亚洲精品狼色在线| 日韩中文字幕麻豆| 麻豆视频观看网址久久| 青青草国产成人99久久| 日韩欧美色电影| 亚洲成av人在线观看| 国产精品免费视频网站| 国产精品久久久久久久久久免费看| 欧美激情一区二区三区不卡| 国产无人区一区二区三区| 亚洲国产成人午夜在线一区| 亚洲国产精品激情在线观看| 国产精品成人免费精品自在线观看| 国产精品久久久久婷婷| 亚洲欧美日韩在线| 亚洲aⅴ怡春院| 亚洲一区在线视频观看| 一区二区高清免费观看影视大全| 椎名由奈av一区二区三区| 国产精品天干天干在线综合| 国产精品久久久久久久久图文区 | 亚洲欧美电影院| 亚洲一区免费在线观看| 国内久久婷婷综合| 欧美亚洲综合久久| 欧美电影一区二区| 亚洲特黄一级片| 国产成人免费视频网站| 欧美日韩国产美女| 国产精品传媒视频| 视频一区在线播放| 婷婷成人综合网| 色综合亚洲欧洲| 亚洲欧洲色图综合| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 亚洲视频精选在线| 国产激情精品久久久第一区二区 | 综合久久给合久久狠狠狠97色| 国产精品一区二区无线| 91精品国产一区二区三区蜜臀| 国产精品久久久爽爽爽麻豆色哟哟| 免费看日韩a级影片| 3d成人动漫网站| 免费观看一级特黄欧美大片| 51午夜精品国产| 黄色日韩网站视频| 久久久久久久久一| 成人免费毛片app| 综合在线观看色| 欧美视频中文字幕| 免费成人在线网站| 国产欧美日韩在线看| jlzzjlzz国产精品久久| 日韩中文字幕91| 99久久久无码国产精品| 日韩一区二区视频| 极品美女销魂一区二区三区免费| 欧美理论片在线| 国产伦精品一区二区三区免费迷| 国产亚洲欧美色| 欧美视频精品在线观看| 美日韩一区二区| 亚洲国产一区二区三区青草影视| www.亚洲人| 三级影片在线观看欧美日韩一区二区| 精品盗摄一区二区三区| 91麻豆.com| 懂色av一区二区三区免费看| 午夜欧美视频在线观看| 久久久精品人体av艺术| 色狠狠av一区二区三区| 成人性视频免费网站| 激情六月婷婷久久| 亚洲成人资源网| 尤物视频一区二区| 中文一区二区在线观看| 日韩女同互慰一区二区| 91国产精品成人| 91视视频在线观看入口直接观看www | 欧美日韩激情在线| 色哟哟国产精品免费观看| 91香蕉国产在线观看软件| 国产麻豆精品久久一二三| 精品亚洲porn| 狠狠色丁香久久婷婷综| 久久国产麻豆精品| 免费成人你懂的| 国产老女人精品毛片久久| 国产精品中文字幕日韩精品| 另类综合日韩欧美亚洲| 天堂va蜜桃一区二区三区漫画版| 亚洲国产精品t66y| 亚洲图片另类小说| 亚洲人一二三区| 亚洲情趣在线观看| 亚洲精品高清在线| 精品夜夜嗨av一区二区三区| 日韩精品久久理论片| 激情文学综合插| 91在线免费看| 欧美成人综合网站| 亚洲手机成人高清视频| 日韩国产欧美在线播放| 国产suv精品一区二区6| 欧美色图第一页| 中文字幕国产一区| 免费人成精品欧美精品| 成人av免费网站| 精品少妇一区二区三区在线视频| 国产午夜久久久久| 亚洲欧美一区二区三区国产精品| 亚洲精品一区二区三区影院| 国产亚洲精品福利| 日本视频中文字幕一区二区三区| 99久久夜色精品国产网站| 久久网站热最新地址| 久久国产视频网| 国产成人精品www牛牛影视| 97国产一区二区| 久久婷婷久久一区二区三区| 亚洲精品中文字幕乱码三区 | 欧美国产精品一区| 丝瓜av网站精品一区二区| 色天天综合久久久久综合片| 欧美国产在线观看| 成人午夜电影小说| 国产人妖乱国产精品人妖| 经典三级视频一区| 欧美精品一区二区三区久久久| 日韩在线一区二区三区| 欧美精品乱码久久久久久按摩| 亚洲免费色视频| 欧美乱熟臀69xxxxxx| 裸体歌舞表演一区二区| 国产农村妇女毛片精品久久麻豆| 懂色av中文一区二区三区| 日韩美女视频19| 欧美日韩一级黄| 国产精品一级在线| 一区二区三区高清在线| 欧美一区二区三区视频免费播放| 日韩电影在线免费| 欧美一区二区啪啪| 成人激情图片网| 青青青爽久久午夜综合久久午夜| 国产亚洲精品超碰| 6080午夜不卡| 91网站最新网址| 国产精品一区免费视频| 亚洲一二三级电影| 亚洲色欲色欲www| 国产亚洲欧洲一区高清在线观看| 色天天综合久久久久综合片| 久久99精品久久只有精品| 亚洲1区2区3区视频|