3 Replies Latest reply on Aug 19, 2005 11:21 AM by jcoffee

    EAR postStart and preStop activities

    jcoffee

      Hi, I'm trying to do something on JBoss 3.2.6 which is very simple on BEA: Invoke some specific action before an EAR is undeployed and after is has been (re)deployed. I managed to couple these activities with starting and stopping the whole server by deploying a service definition in my configurations default/ directory. But I have no clue how to do this in conjunction with the applications lifecycle.

      Thanks for any help or link.

      Klaus

        • 1. Re: EAR postStart and preStop activities
          darranl

          You could have a look at the following for notifications from the deployers: -

          http://wiki.jboss.org/wiki/Wiki.jsp?page=ReceiveJMXDeploymentNotifications

          • 2. Re: EAR postStart and preStop activities
            jcoffee

            Thanks for your quick reply. It at least points the direction. But it's still hard for me to figure out what actually to write and where to put it. (Documentation has never been a strength of JBoss. Hope the books I've ordered will mend this...)

            Klaus

            • 3. Re: EAR postStart and preStop activities
              jcoffee

              Now I managed to get a start notification of the EARDeployer. But no chance to get a notification before undeploy. My jboss-service.xml is like:

               <server>
               <mbean code="com.jcoffee.test.jboss.NotificationListener"
               name="jcoffee.ear:name=NotificationListener">
              
               <attribute name="SubscriptionList">
               <subscription-list>
               <mbean name="jboss.j2ee:service=EARDeployer"/>
               </subscription-list>
               </attribute>
               </mbean>
               </server>
              

              My listener class extends ListenerServiceMBeanSupport, subscribes in startService() with subscribe(true) and implements handleNotification2(). All this put in an SAR , added to my EAR and declared in jboss-app.xml deploys nicely, but all I can get is a notification after (re)deploy but none before undeploy. Anyone any comments on this?