donaldp 01/04/24 20:16:04 Modified: src/java/org/apache/phoenix/engine PhoenixEmbeddor.java Log: Reflected changes in Embeddor interface. Revision Changes Path 1.10 +52 -25 jakarta-avalon-phoenix/src/java/org/apache/phoenix/engine/PhoenixEmbeddor.java Index: PhoenixEmbeddor.java =================================================================== RCS file: /home/cvs/jakarta-avalon-phoenix/src/java/org/apache/phoenix/engine/PhoenixEmbeddor.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- PhoenixEmbeddor.java 2001/04/25 01:30:57 1.9 +++ PhoenixEmbeddor.java 2001/04/25 03:16:04 1.10 @@ -102,46 +102,74 @@ } /** - * This is the main method of the embeddor. It sets up the core - * components, and then deploys the <code>Facilities</code>. These - * are registered with the Kernel and the Manager. The same - * happens for the <code>Applications</code>. - * Now, the Kernel is taken through its lifecycle. When it is - * finished, as well as all the applications running in it, it - * is shut down, after which the PhoenixEmbeddor is as well. + * Setup and Start the Logger, Deployer, SystemManager and Kernel. + * + * @exception Exception if an error occurs */ - public void execute() + public void start() throws Exception { try { // setup core handler components setupComponents(); - deployDefaultApplications(); + //TODO: Deploying should go into execute!!! + deployDefaultApplications(); + m_systemManager.start(); - + m_kernel.start(); - - // loop until <code>Shutdown</code> is created. - while( !m_shutdown ) - { - // loop - - // wait() for shutdown() to take action... - try { synchronized( this ) { wait(); } } - catch( final InterruptedException e ) {} - } } catch( final Exception e ) { // whoops! - getLogger().fatalError( "There was a fatal error while running phoenix.", e ); + getLogger().fatalError( "There was a fatal error while starting phoenix.", e ); throw e; } } /** + * This is the main method of the embeddor. It sets up the core + * components, and then deploys the <code>Facilities</code>. These + * are registered with the Kernel and the Manager. The same + * happens for the <code>Applications</code>. + * Now, the Kernel is taken through its lifecycle. When it is + * finished, as well as all the applications running in it, it + * is shut down, after which the PhoenixEmbeddor is as well. + */ + public void execute() + throws Exception + { + //TODO: Insert default deployment here... + + // loop until <code>Shutdown</code> is created. + while( !m_shutdown ) + { + // wait() for shutdown() to take action... + try { synchronized( this ) { wait(); } } + catch( final InterruptedException e ) {} + } + } + + /** + * Shutdown all the resources associated with kernel. + */ + public void stop() + throws Exception + { + if( null != m_systemManager ) + { + m_systemManager.stop(); + } + + if( null != m_kernel ) + { + m_kernel.stop(); + } + } + + /** * Release all the resources associated with kernel. */ public void dispose() @@ -149,19 +177,18 @@ { if( null != m_systemManager ) { - m_systemManager.stop(); m_systemManager.dispose(); + m_systemManager = null; } if( null != m_kernel ) { - m_kernel.stop(); m_kernel.dispose(); + m_kernel = null; } - m_systemManager = null; - m_kernel = null; m_deployer = null; + System.gc(); // make sure resources are released } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]