I am using JBoss 4.0.2 with the BarrierController service in order to have some 
custom MBeans depend upon the starting of the Tomcat connectors.  Upon startup, 
everything works just as expected, but upon shutdown of the application server, 
the "stop" method of my custom MBeans is never called.

To verify that my MBean is working correctly, I removed the dependency on the 
BarrierController service (the MBean it dynamically creates), and all works as 
expected including the stop method.

I've added my BarrierController XML and a simple Test MBean code below (in case 
I am doing something crazy), but could I have happened upon a bug?  In the Test 
MBean code below, the "Stopping..." log message is never printed when the 
dependency to the BarrierController is added.

<server>
  |   <mbean code="org.jboss.system.BarrierController"
  |          name="jboss:service=BarrierController">
  | 
  |     <attribute name="BarrierEnabledOnStartup">false</attribute>
  |     <attribute name="DynamicSubscriptions">true</attribute>
  |     <attribute name="BarrierObjectName">
  |         com.acxiom.grid.jboss.services:name=TomcatConnectors,type=Barrier
  |     </attribute>
  |     <attribute name="StartBarrierHandback">start</attribute>
  |     <attribute name="StopBarrierHandback">stop</attribute>
  |     <attribute name="SubscriptionList">
  |       <subscription-list>
  |         <mbean name="jboss.web:service=WebServer" handback="start">
  |           <filter factory="NotificationFilterSupportFactory">
  |             <enable type="jboss.tomcat.connectors.started"/>
  |           </filter>
  |         </mbean>
  |         <mbean name="jboss.system:type=Server" handback="stop">
  |           <filter factory="NotificationFilterSupportFactory">
  |             <enable type="org.jboss.system.server.stopped"/>
  |           </filter>
  |         </mbean>
  |       </subscription-list>
  |     </attribute>
  |   </mbean>
  | </server>

package com.acxiom.grid.jboss.services.test;
  | 
  |  public interface TestMBean
  |  {
  |      void start();
  | 
  |      void stop();
  |  }

package com.acxiom.grid.jboss.services.test;
  | 
  | import org.apache.log4j.Logger;
  | 
  | public class Test implements TestMBean
  | {
  |     Logger logger;
  | 
  |     public Test()
  |     {
  |         logger = Logger.getLogger(getClass());
  |     }
  | 
  |     public void start()
  |     {
  |         logger.info("Starting...");
  |     }
  | 
  |     public void stop()
  |     {
  |         logger.info("Stopping...");
  |     }
  | }

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917197#3917197

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917197


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to