public synchronized final void start ( ) throws Exception { if ( _started || _starting ) return ; _starting = true ; if ( log . isDebugEnabled ( ) ) log . debug ( "Starting " + this ) ; LifeCycleEvent event = new LifeCycleEvent ( this ) ; for ( int i = 0 ; i < LazyList . size ( _eventListeners ) ; i ++ ) { EventListener listener = ( EventListener ) LazyList . get ( _eventListeners , i ) ; if ( listener instanceof LifeCycleListener ) ( ( LifeCycleListener ) listener ) . lifeCycleStarting ( event ) ; } try { doStart ( ) ; _started = true ; log . info ( "Started " + this ) ; for ( int i = 0 ; i < LazyList . size ( _eventListeners ) ; i ++ ) { EventListener listener = ( EventListener ) LazyList . get ( _eventListeners , i ) ; if ( listener instanceof LifeCycleListener ) ( ( LifeCycleListener ) listener ) . lifeCycleStarted ( event ) ; } } catch ( Throwable e ) { LifeCycleEvent failed = new LifeCycleEvent ( this , e ) ; for ( int i = 0 ; i < LazyList . size ( _eventListeners ) ; i ++ ) { EventListener listener = ( EventListener ) LazyList . get ( _eventListeners , i ) ; if ( listener instanceof LifeCycleListener ) ( ( LifeCycleListener ) listener ) . lifeCycleFailure ( event ) ; } if ( e instanceof Exception ) throw ( Exception ) e ; if ( e instanceof RuntimeException ) throw ( RuntimeException ) e ; if ( e instanceof Error ) throw ( Error ) e ; log . warn ( LogSupport . EXCEPTION , e ) ; } finally { _starting = false ; } }
Start the server . Generate LifeCycleEvents for starting and started either side of a call to doStart