views:

41

answers:

1

I am working on a project that consists of several ESB Applications deployed on a JBoss Application Server.

Each ESB Application processes messages (validate, enrich...) through several actions (they extend AbstractActionLifecycle); Some of those actions are identical for all applications.

To avoid code duplication I moved all actions that are used more than once into a CommonService.esb Application. This approach works fine so far except for one problem:

When I re-deploy the CommonService.esb, I expected all actions to be reloaded. However, this is not the case. No new Instances of the actions are created and the old instances are still there. I understand why this is happening (JBoss still has references to these actions, thus no garbage collection), but I wonder if there is a fix to it.

Can I ask JBoss reload its actions? Is there a better approach to share actions used in more than one place?

+1  A: 

JBoss can/will reload the actions once it is told that there is a dependency between the two projects.

I added the following to the META-INF/deployment.xml of all other projects.

<?xml version="1.0" encoding="UTF-8"?>
    <jbossesb-deployment>
    <depends>jboss.esb:deployment=CommonServices.esb</depends>
</jbossesb-deployment>
phisch