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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? servicegroup.java

?? 一個java方面的消息訂閱發送的源碼
?? JAVA
字號:
/**
 * Redistribution and use of this software and associated documentation
 * ("Software"), with or without modification, are permitted provided
 * that the following conditions are met:
 *
 * 1. Redistributions of source code must retain copyright
 *    statements and notices.  Redistributions must also contain a
 *    copy of this document.
 *
 * 2. Redistributions in binary form must reproduce the
 *    above copyright notice, this list of conditions and the
 *    following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. The name "Exolab" must not be used to endorse or promote
 *    products derived from this Software without prior written
 *    permission of Exoffice Technologies.  For written permission,
 *    please contact info@exolab.org.
 *
 * 4. Products derived from this Software may not be called "Exolab"
 *    nor may "Exolab" appear in their names without prior written
 *    permission of Exoffice Technologies. Exolab is a registered
 *    trademark of Exoffice Technologies.
 *
 * 5. Due credit should be given to the Exolab Project
 *    (http://www.exolab.org/).
 *
 * THIS SOFTWARE IS PROVIDED BY EXOFFICE TECHNOLOGIES AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 * EXOFFICE TECHNOLOGIES OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Copyright 1999-2004 (C) Exoffice Technologies Inc. All Rights Reserved.
 */

package org.exolab.jms.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;


/**
 * ServiceGroup is responsible for managing a collection of 
 * {@link Serviceable} objects. 
 * <br>
 * All serviceable objects are named and no two sevices can have the same 
 * name. 
 *
 * @version     $Revision: 1.1 $ $Date: 2004/11/26 01:51:01 $
 * @author      <a href="mailto:jima@comware.com.au">Jim Alateras</a>
 * @see         BasicService
 * @see         Service
 * @see         Serviceable
 */
public class ServiceGroup {

    /**
     * A map of service names to the actual services
     */
    private HashMap _services = new HashMap();

    /**
     * Maintains the order in which services have been added to the
     * service manager
     */
    private ArrayList _serviceOrder = new ArrayList();

    /**
     * The logger
     */
    private static final Log log = LogFactory.getLog(ServiceGroup.class);


    /**
     * Create a new service group
     */
    public ServiceGroup() {
    }

    /**
     * Add the named service to the collection of managed services. 
     * The service must be in the STOPPED state before it can be added to the 
     * manager.
     * <p>
     * The {@link #startAll} method will start the services in the order that 
     * they were added to the ServiceGroup. Therefore if one service is 
     * dependent on another ensure that they are added in the correct order. 
     * Similarly {@link #stopAll} will stop the services in the reverse order 
     * to which they were started.
     *
     * @param name the name of the sevice
     * @param service the service to add
     * @throws ServiceAlreadyExistsException if a service exists with the same
     * name
     * @throws ServiceManagerException if the service is not in the stopped 
     * state
     */
    public synchronized void add(String name, Serviceable service)
        throws ServiceAlreadyExistsException, ServiceManagerException {
        if (_services.containsKey(name)) {
            throw new ServiceAlreadyExistsException(
                "Service with name=" + name + " has already been registered");
        }

        if (!service.getState().isStopped()) {
            throw new ServiceManagerException(
                "Service with name=" + name + " is in state=" + 
                service.getState());
        }

        _services.put(name, service);
        _serviceOrder.add(name);
    }

    /**
     * Remove the named service from the ServiceGroup. The service must be
     * in the 'stopped' state before it can be removed. 
     *
     * @param name the name of the service to remove
     * @throws ServiceDoesNotExistException if the named service doesn't exist
     * @throws ServiceManagerException if a client tries to remove a service 
     * that is not stopped.
     */
    public synchronized void remove(String name)
        throws ServiceDoesNotExistException, ServiceManagerException {
        if (!_services.containsKey(name)) {
            throw new ServiceDoesNotExistException("Service with name " +
                name + " is not registered");
        }

        Serviceable service = (Serviceable) _services.get(name);
        if (!service.getState().isStopped()) {
            throw new ServiceManagerException(
                "Cannot remove service=" + name + " while it is in state=" + 
                service.getState());
        } else {
            _services.remove(name);
            _serviceOrder.remove(name);
        }
    }

    /**
     * Remove the specified service from the ServiceGroup. It delegates
     * the responsiblity to <i>remove(String)</i> method.
     *
     * @param service the service to remove
     * @throws ServiceDoesNotExistException if the service isn't registered
     * @throws ServiceManagerException if a client tries to remove a service 
     * that is not stopped.
     */
    public synchronized void remove(Serviceable service)
        throws ServiceDoesNotExistException, ServiceManagerException
    {
        remove(service.getName());
    }

    /**
     * Return an enumeration of the registered service names
     *
     * @return an enumeration of service names
     */
    public synchronized Iterator getServiceNames() {
        return new ArrayList(_serviceOrder).iterator();
    }

    /**
     * Return the service specified by name, or null if one does not exist
     *
     * @param name the service name
     * @return the service, or null if non-existent
     */
    public synchronized Serviceable getServiceByName(String name) {
        return (Serviceable) _services.get(name);
    }

    /**
     * Start all the services in their registered order. If a service is 
     * already running then it is ignored. If one or more services could
     * not be started then the ServiceManagerException is raised. The 
     * exception will only indicate the first service that failed to 
     * start.
     *
     * @throws ServiceManagerException
     */
    public synchronized void startAll() throws ServiceManagerException {
        Iterator iter = _serviceOrder.iterator();
        while (iter.hasNext()) {
            String name = (String) iter.next();
            Serviceable service = getServiceByName(name);
            try {
                if (!service.getState().isRunning()) {
                    service.start();
                    log.info("Started service [" + service.getName() + "]");
                }
            } catch(ServiceException exception) {
                // log the error and rethrow
                log.error(exception);
                throw new ServiceManagerException(exception);
            }
        }
    }

    /**
     * Stop all the services in their reverse registered order. If a sevice
     * is already stopped then it is ignored. If one or more services could
     * not be stopped an appropriate error will be logged
     */
    public synchronized void stopAll() {
        Iterator iter = _serviceOrder.iterator();
        while (iter.hasNext()) {
            String name = (String) iter.next();
            Serviceable service = getServiceByName(name);
            if (!service.getState().isStopped()) {
                try {
                    service.stop();
                    log.info("Stopped service [" + service.getName() + "]");
                } catch(ServiceException exception) {
                    log.error(exception);
                }
            }
        }
    }

    /**
     * Remove all registered services. All services are stopped before removal
     */
    public synchronized void removeAll() {
        stopAll();
        _services.clear();
        _serviceOrder.clear();
    }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看av一区二区| 免费一级片91| 中文字幕第一区综合| 精品理论电影在线观看 | 欧美日韩dvd在线观看| 成人精品视频一区| 成人一区二区三区中文字幕| 不卡高清视频专区| 99视频在线观看一区三区| 97精品国产97久久久久久久久久久久| 国产精品小仙女| 99久久精品国产网站| 欧美视频在线观看一区| 91精品国产91久久久久久一区二区| 91麻豆精品国产| 国产精品全国免费观看高清| 亚洲人午夜精品天堂一二香蕉| 一区二区在线观看免费视频播放| 亚洲精品久久久久久国产精华液| 午夜精品aaa| 韩国一区二区视频| 99精品视频一区| 欧美日韩一级视频| 精品噜噜噜噜久久久久久久久试看 | 国产日韩精品一区| 亚洲色欲色欲www| 亚洲国产日韩综合久久精品| 麻豆精品久久精品色综合| 成人性生交大合| 91国产免费看| 日韩视频免费观看高清完整版 | 色综合久久88色综合天天6| 91黄视频在线| 久久婷婷色综合| 一区二区三区在线影院| 久久99久久久欧美国产| 99re热视频精品| 欧美不卡一二三| 亚洲制服欧美中文字幕中文字幕| 韩国成人精品a∨在线观看| 在线观看欧美黄色| 国产午夜亚洲精品理论片色戒| 亚洲午夜精品网| 福利电影一区二区三区| 欧美一区二区精品| 亚洲日本在线观看| 国产精品18久久久久久久久久久久 | 亚洲日本va午夜在线电影| 视频一区欧美精品| 91在线观看下载| 国产亚洲污的网站| 天天免费综合色| 在线免费观看日韩欧美| 中文字幕第一区二区| 精品亚洲免费视频| 欧美精品日日鲁夜夜添| 中文字幕永久在线不卡| 亚洲美女精品一区| 国产亚洲成av人在线观看导航 | 国产精品66部| 日韩电影一二三区| 亚洲自拍欧美精品| 另类小说色综合网站| 久久蜜桃av一区二区天堂| av电影天堂一区二区在线观看| 亚洲成人资源网| 专区另类欧美日韩| 中文成人av在线| 51精品秘密在线观看| 色综合久久久久网| 成人av电影免费在线播放| 亚洲免费av高清| 韩国成人在线视频| 欧美日韩你懂得| 亚洲国产一二三| 欧美视频自拍偷拍| 一区二区三区在线免费视频| 成人激情小说乱人伦| 1024成人网| 日本精品一区二区三区四区的功能| 亚洲日穴在线视频| 色狠狠综合天天综合综合| 自拍av一区二区三区| 色噜噜久久综合| 亚洲综合视频网| 欧美日韩一区高清| 美女在线观看视频一区二区| 亚洲精品一区二区三区影院| 国产剧情在线观看一区二区| 国产精品美女久久久久久久久久久 | 亚洲国产精品成人综合| 丰满亚洲少妇av| 亚洲色欲色欲www在线观看| 91理论电影在线观看| 一区二区三区欧美| 91精品国产综合久久精品app| 蜜乳av一区二区三区| 久久综合九色综合欧美98| 成人av免费在线观看| 亚洲精品成人天堂一二三| 91精选在线观看| 国产激情精品久久久第一区二区 | 亚洲成a人v欧美综合天堂下载 | 色久综合一二码| 另类小说一区二区三区| 国产精品美女久久久久久久久久久| 色先锋aa成人| 久99久精品视频免费观看| 专区另类欧美日韩| 精品日韩在线一区| 91片在线免费观看| 久久精品国产网站| 伊人色综合久久天天人手人婷| 欧美一区二区三区在线视频| 99精品视频在线播放观看| 免播放器亚洲一区| 亚洲精品你懂的| 国产日韩精品视频一区| 欧美电影在哪看比较好| 99久久99久久精品免费看蜜桃| 日韩极品在线观看| 亚洲卡通欧美制服中文| www久久久久| 欧美一区二区日韩一区二区| 91亚洲午夜精品久久久久久| 国产麻豆成人传媒免费观看| 亚洲第一二三四区| 日韩美女精品在线| 欧美激情在线观看视频免费| 91麻豆精品国产91久久久久| 日本福利一区二区| 99精品欧美一区二区三区小说 | 一区二区三区在线播| 久久久久国产一区二区三区四区 | 国产精品蜜臀av| 亚洲精品在线电影| 91精品国产91久久久久久最新毛片| 99精品黄色片免费大全| 国产91精品久久久久久久网曝门| 丝袜亚洲另类欧美| 亚洲国产日韩av| 国产精品毛片久久久久久久| 久久久www成人免费无遮挡大片| 538在线一区二区精品国产| 欧美日韩在线播| 欧美性生交片4| 国产精品中文有码| 亚洲无人区一区| 亚洲精品国产精华液| 中文字幕视频一区二区三区久| 日本一区二区视频在线观看| 久久久久久免费毛片精品| 精品国产欧美一区二区| 日韩免费电影一区| 日韩久久精品一区| 精品入口麻豆88视频| 久久先锋影音av鲁色资源网| 久久久精品蜜桃| 国产精品视频免费| 中文字幕日韩av资源站| 伊人色综合久久天天| 亚洲成人激情社区| 日韩精品一级二级| 国内精品久久久久影院一蜜桃| 国产成人亚洲综合a∨婷婷图片 | 欧美日韩性生活| 欧美日韩高清一区| 精品女同一区二区| 成人av资源在线| 国产精品影音先锋| 六月丁香综合在线视频| 青娱乐精品在线视频| 激情六月婷婷久久| 国产iv一区二区三区| 91偷拍与自偷拍精品| 欧美性大战久久久久久久蜜臀| 欧美三级在线播放| 久久蜜臀中文字幕| 一区二区三区在线免费播放| 欧美aⅴ一区二区三区视频| 国产v日产∨综合v精品视频| 色婷婷国产精品综合在线观看| 欧美精品在线观看播放| 久久久青草青青国产亚洲免观| 亚洲欧美中日韩| 日韩电影在线观看电影| 粉嫩av一区二区三区| 色偷偷久久一区二区三区| 精品视频在线免费看| 久久夜色精品国产欧美乱极品| 国产精品入口麻豆原神| 日本欧美一区二区在线观看| 国产精品自拍一区| 欧美高清你懂得| 国产精品福利影院| 精品在线免费观看| 欧美日韩一二三区| 中文字幕一区二区三区av | 欧美亚洲日本国产| 久久久久久久久久久久久夜|