[jboss-user] [Microcontainer] - Re: Deployers and service dependencies

alesj do-not-reply at jboss.com
Mon Mar 16 16:20:31 EDT 2009


"heiko.braun at jboss.com" wrote : I am currently looking into DependenciesMetaData. 
  | 
You don't need DependenciesMetaData unless you're really creating it
and as such delegating the work to true DependenciesMetaDataDeployer.

e.g. you could just provide the right DependenciesMetaData into attachments
which would then be picked up by the deployer that already handles it.
Hence no need for your deployer to explicitly add dependency items

"heiko.braun at jboss.com" wrote : 
  | 1) jboss-dependency.xml works with a single deployment unit.
  | 
Not really.
You can have multiple jboss-dependency.xmls in multiple (sub)deployments.
But at the end, they all get added to top deployment,
as that's the only one we track in MC's state machine.

"heiko.braun at jboss.com" wrote : 
  | 2) Hence I introduced a deployer that prepares the dependencies for particular deployments similar to what the Ejb3DependencyDeployer does:
  | 
  | 
  |   |  public JBPMDependenciesDeployer()
  |   |   {
  |   |     setStage(DeploymentStages.PRE_REAL);
  |   |     setOutput(DependenciesMetaData.class);
  |   | 
  |   |     DeploymentVisitor<JBPMDeploymentMetaData> visitor = new DeploymentVisitor<JBPMDeploymentMetaData>()
  |   |     {
  |   |       public void deploy(DeploymentUnit unit, JBPMDeploymentMetaData deployment)
  |   |           throws DeploymentException
  |   |       {
  |   |         log.info("Encountered deployment " + unit);
  |   | 
  |   |         unit.addIDependOn(
  |   |             new AbstractDependencyItem(unit.getName(),
  |   |                 TransactionManager.class,
  |   |                 new ControllerState("Real"),
  |   |                 ControllerState.INSTALLED)
  |   |         );
  |   |       }
  |   | [...]
  |   | }
  |   | 
  | 
  | I would expect any JBPMDeploymentMetaData that passes the visitor to have a dependency on the TransactionManager. Right?
  | Which means to me, that upon undeployment these deployment units are processed before the TM leaves INSTALLED and hence would still be still be available.
  | 
  | Is that how it should work? Maybe the error is somewhere else.
  | 
This looks OK.
What's the error?

But as suggested, I would do it differently.
I would just create a proper version of DependenciesMetaData,
leaving its deployment to DependenciesMetaDataDeployer and DeploymentDependencyDeployer.
Just make sure they are in the right deployment stage.


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

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



More information about the jboss-user mailing list