首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Chapter 二 - Jetty读取配置文件和Loader(3)

2012-10-16 
Chapter 2 - Jetty读取配置文件和Loader(3)Server的启动AbstractLifeCycle实现了LifeCycle接口(start(), s

Chapter 2 - Jetty读取配置文件和Loader(3)
Server的启动

AbstractLifeCycle实现了LifeCycle接口(start(), stop()),并提供了doStart()和doStop()方法

    protected void doStart() throws Exception    {        for (int i=0;_realms !=null && i<_realms.length; i++)        {            if (_realms[i] instanceof LifeCycle)                ((LifeCycle)_realms[i]).start();        }        Iterator itor = _dependentLifeCycles.iterator();        while (itor.hasNext())        {               try            {                ((LifeCycle)itor.next()).start();             }            catch (Throwable e) {mex.add(e);}        }                if (_threadPool==null)        {            QueuedThreadPool tp=new QueuedThreadPool();            setThreadPool(tp);        }                if (_sessionIdManager!=null)            _sessionIdManager.start();                try        {            if (_threadPool instanceof LifeCycle)                ((LifeCycle)_threadPool).start();        }         catch(Throwable e) { mex.add(e);}                try         {             super.doStart();         }         catch(Throwable e)         {             Log.warn("Error starting handlers",e);        }                if (_connectors!=null)        {            for (int i=0;i<_connectors.length;i++)            {                try{_connectors[i].start();}                catch(Throwable e)                {                    mex.add(e);                }            }        }        mex.ifExceptionThrow();    }

热点排行