2 Replies Latest reply on Sep 14, 2005 2:37 PM by Scott Stark

    want to detect hot-deployment of jar in exploded sar

    mazz Master

      I want to be able to detect the hot-deployment/hot-undeployment of jar files in an exploded sar. Basically, I have some services in my sar that wants to known when new jars are added and removed so it can do some special things. The jar itself still must be added/removed to/from the sar's classloader as any normal .jar would.

      I'm not even sure its possible to get notified when a .jar file changes inside of a .sar, so I guess that's the first question I have to ask.

      Example, I have "my.sar" that is started, JBoss running fine. I then add "my-special.jar" to my sar directory:

      deploy/default/my.sar/
      deploy/default/my.sar/my-special.jar

      I want a service running in my sar to know that "my-special.jar" was just added to my .sar directory. Also, if someone deletes "my-special.jar", I want to know about that to.

      I thought about adding my own deployer, but if I do that, I'd need to use a different extension (rather than .jar, I would need to use .XXX for example). If I do that, then I think the "my-special.XXX" won't actually make it into my classloader (unless I do it myself - if its even possible at all given just a DeploymentInfo).

      I tried adding a JMX listener to JARDeployer, but if I add or remove a jar from my sar, I'm not getting any notifications from it. I also tried listening to SARDeployer but that also didn't emit notifications when the jars were added/removed.

      Any thoughts on how I can go about doing this? Is a new deployer the way to go or should I continue trying to get the deployer listener stuff to work (though I'm not quite sure how I can get this to work).