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

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

?? remotescheduler.java

?? Java中非常實用流控制工具
?? 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一区二区三区免费野_久草精品视频
精一区二区三区| 欧美三级电影在线看| 最近日韩中文字幕| av电影在线观看一区| 亚洲欧美日韩久久精品| 欧美视频在线不卡| 日本美女一区二区| 精品福利二区三区| 成人精品免费看| 亚洲精选免费视频| 7777女厕盗摄久久久| 激情另类小说区图片区视频区| 国产日产欧产精品推荐色 | 激情欧美一区二区| 国产精品日产欧美久久久久| 99精品黄色片免费大全| 亚洲一卡二卡三卡四卡| 日韩精品一区二区三区在线观看| 国产在线精品一区二区三区不卡 | 欧美一区日韩一区| 国产精品99久久久久久久vr| 亚洲色大成网站www久久九九| 欧美日韩一区久久| 国产精品自拍毛片| 亚洲人成网站色在线观看| 91精品国产综合久久精品麻豆| 国模套图日韩精品一区二区 | 成人午夜av电影| 亚洲午夜激情网页| 久久综合成人精品亚洲另类欧美 | 99久久婷婷国产| 偷拍日韩校园综合在线| 久久久国产综合精品女国产盗摄| 92精品国产成人观看免费| 丝袜诱惑亚洲看片| 日本一区二区三级电影在线观看| 欧美主播一区二区三区美女| 极品美女销魂一区二区三区免费| 日韩理论片在线| 欧美电视剧免费全集观看 | 波多野洁衣一区| 日韩高清不卡在线| 中文字幕字幕中文在线中不卡视频| 制服丝袜一区二区三区| 99久久99精品久久久久久 | 精品一区二区三区视频在线观看| 日韩美女久久久| 精品国产电影一区二区| 在线精品国精品国产尤物884a| 国产一区二区三区不卡在线观看 | 麻豆精品国产91久久久久久| 自拍偷自拍亚洲精品播放| 欧美v国产在线一区二区三区| 一本色道a无线码一区v| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲综合色自拍一区| 中文在线一区二区 | 制服丝袜亚洲精品中文字幕| 成人激情动漫在线观看| 蜜桃一区二区三区在线观看| 亚洲一区视频在线| 中文字幕+乱码+中文字幕一区| 日韩欧美在线网站| 欧美三级在线看| a级精品国产片在线观看| 久99久精品视频免费观看| 亚洲永久免费视频| 国产精品你懂的| 久久先锋影音av鲁色资源网| 欧美人xxxx| 在线影视一区二区三区| 成人激情免费视频| 国产精品91一区二区| 麻豆一区二区三区| 日韩在线卡一卡二| 亚洲资源中文字幕| ●精品国产综合乱码久久久久| 久久网站最新地址| 日韩一卡二卡三卡国产欧美| 欧美性视频一区二区三区| 色综合色狠狠天天综合色| 成人一区二区在线观看| 精品一二三四区| 青青国产91久久久久久| 亚洲国产一区二区视频| 亚洲男人电影天堂| 国产精品成人免费在线| 国产欧美综合色| 久久精品亚洲一区二区三区浴池| 日韩精品最新网址| 日韩一区二区高清| 欧美一区二区三区日韩视频| 欧美精品久久99久久在免费线| 欧美在线免费观看亚洲| 色老综合老女人久久久| 一本久久a久久精品亚洲| 97久久久精品综合88久久| 成人在线一区二区三区| 成人午夜视频在线| 成人自拍视频在线观看| 成人动漫av在线| 成人激情免费电影网址| 成人av午夜电影| 成人激情动漫在线观看| caoporen国产精品视频| 99v久久综合狠狠综合久久| 99麻豆久久久国产精品免费优播| 成年人国产精品| 99久久精品99国产精品| 色域天天综合网| 色噜噜狠狠成人中文综合| 日本韩国欧美一区| 欧美性猛交xxxxxx富婆| 在线观看av不卡| 欧美日韩国产123区| 欧美一区国产二区| 日韩视频在线观看一区二区| 日韩精品一区二区三区在线观看 | 欧美日韩在线直播| 91精品一区二区三区久久久久久| 欧美一区二区三区视频在线观看| 日韩欧美中文一区| www国产亚洲精品久久麻豆| 久久美女艺术照精彩视频福利播放| 国产亚洲成av人在线观看导航 | 成人av网在线| 成人99免费视频| 欧洲中文字幕精品| 宅男在线国产精品| 久久综合五月天婷婷伊人| 国产免费成人在线视频| 亚洲男同性恋视频| 日韩国产精品久久久久久亚洲| 久久se这里有精品| 国产 日韩 欧美大片| 色激情天天射综合网| 91精品国产欧美一区二区| 久久中文娱乐网| 亚洲欧洲日韩在线| 亚洲bdsm女犯bdsm网站| 极品少妇xxxx偷拍精品少妇| 成人久久视频在线观看| 欧美色偷偷大香| 欧美精品一区二区三区四区 | 欧美日本国产视频| 日韩精品一区在线观看| 国产精品嫩草99a| 亚洲最大色网站| 久久精品国产秦先生| 成人免费视频一区| 欧美日韩在线一区二区| 久久人人爽爽爽人久久久| 中文字幕一区二区三区不卡在线| 亚洲成人综合在线| 国产乱妇无码大片在线观看| 色综合天天性综合| 欧美一级日韩免费不卡| 中文字幕免费观看一区| 亚洲国产一区在线观看| 国产精品一区二区91| 一本色道久久综合狠狠躁的推荐| 日韩欧美成人激情| 亚洲欧洲一区二区三区| 免费一区二区视频| 本田岬高潮一区二区三区| 91 com成人网| 国产精品麻豆视频| 日韩国产精品久久| 99re这里只有精品6| 日韩精品一区二区三区视频播放| 国产精品不卡在线| 精品一区在线看| 色狠狠av一区二区三区| 精品国产91亚洲一区二区三区婷婷| 亚洲精品日韩综合观看成人91| 国内精品久久久久影院色| 色婷婷av一区二区三区gif | 欧美精品一区在线观看| 夜夜亚洲天天久久| 国产成人在线视频网站| 在线播放中文字幕一区| 亚洲人成网站在线| 国产精品一区二区不卡| 91精品国产欧美一区二区| 1024亚洲合集| 国产剧情一区在线| 欧美福利视频一区| 亚洲欧美一区二区三区国产精品 | 国产一区欧美二区| 欧美中文字幕一二三区视频| 欧美国产一区视频在线观看| 美腿丝袜亚洲三区| 欧洲一区在线电影| 中文字幕成人av| 精品一区二区三区欧美| 欧美精品视频www在线观看| 亚洲人亚洲人成电影网站色| 国产麻豆午夜三级精品| 欧美一区二区三区婷婷月色| 一区二区三区免费网站|