activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dejan Bosanac <dejan.bosa...@ttmsolutions.com>
Subject Re: WebConsole start
Date Fri, 05 Dec 2008 13:49:56 GMT
Maybe a better approach would be to start a Jetty with JMX enabled, so
you can use JConsole to manage it?

If you take this route, however, note that much better approach is to
get Jetty bean by type (not name).

I guess the ActiveMQ OSGi architecture would tackle this nicely?

Cheers

-- 
Dejan Bosanac


http://www.ttmsolutions.com - get a free ActiveMQ user guide

ActiveMQ in Action - http://www.manning.com/snyder/
Scripting in Java - http://www.scriptinginjava.net



yinghe0101 wrote:
> It is using xbean config to start broker and jetty etc.
>
> currently BrokerService jmx stop will stop the broker but embeded jetty
> server will keep running so the java process does not quit without a Ctrl+C.
> and activemq-admin stop has the same effect also activemq-admin stop simply
> calls terminateJVM, eats the exception and just quit( see the
> activemq-console code).
>
> I plan to improve the stopping process and will post on jira when ready.
> Here is some code snippet which will stop jetty when stop() is called:
>
> --- src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java
> (revision 672024)
> +++ src/main/java/org/apache/activemq/xbean/XBeanBrokerService.java	(working
> copy)
> @@ -17,6 +17,7 @@
>  package org.apache.activemq.xbean;
>  
>  import org.apache.activemq.broker.BrokerService;
> +import org.mortbay.jetty.xbean.JettyFactoryBean;
>  import org.springframework.beans.BeansException;
>  import org.springframework.beans.factory.DisposableBean;
>  import org.springframework.beans.factory.InitializingBean;
> @@ -46,7 +47,30 @@
>  
>      public XBeanBrokerService() {
>      }
> -
> +    
> +    /**
> +     * This will cause the java process to quit when calling BrokerService
> stop()
> +     */
> +    public void stopAdditionalProcess()throws Exception{
> +    	if(applicationContext!=null){
> +    		Object
> jettyServerObj=applicationContext.getBean("org.mortbay.jetty.xbean.JettyFactoryBean#0");
> +	    	if(jettyServerObj!=null){
> +	    		JettyFactoryBean jettyServer=(JettyFactoryBean)jettyServerObj;
> +		    	jettyServer.stop();
> +	    	}
> +    	}
> +    }
> +    
> +    public void stop() throws Exception {
> +    	super.stop();
> +    	stopAdditionalProcess();
> +    }
> +    
>
>
>
> yinghe0101 wrote:
>   
>> hi, 
>> Does anyone know how the embedded jetty for admin console starts when I do
>> activemq-admin start?
>>
>> the activemq-admin stop simply calls jmx's terminateJVM to stop the broker
>> which does System.exit(0), if I use jconsole jmx to do stop(), it will
>> stop the broker but not kill jetty admin console and it will be still
>> listening on its port. I want the broker stop() to stop jetty first then
>> shutdown all its connector, is that possible to do?
>>
>> best,
>> ying
>>
>>     
>
>   


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message