[jboss-dev-forums] [Design the new POJO MicroContainer] - Too much implicity

bill.burke@jboss.com do-not-reply at jboss.com
Thu Jun 28 16:51:10 EDT 2007


"adrian at jboss.org" wrote : As an aside, with those classes, it will also know that you don't want to be
  | invoked for deploy/undeploy if there is no such attachment.
  | i.e. no longer any need for the boiler place
  | 
  |   | if (unit.getAttachment(MyMetaData.class) == null)
  |   |    return;
  |   | 
  | If you don't want this filtering, you can turn it off with
  | 
  |   |    public MyDeployer()
  |   |    {
  |   |        super(MyMetaData.class);
  |   |        setAllInputs(true);
  |   |    }
  |   | 
  | 

IMO, there's just too much implicity in both the old and new deployment architecture.  My experience writing the first deployer in this new architecture was that I had to dive through a lot of internal code to figure out what the hell was going on.   It seems like this is getting worse with the new refactoring you did.  I honestly don't care about saving one line of if attachment exists code.  It actually makes the code more readable and more importantly, more understandable for people using your deployer as an example for writing their own.

But back the attachment flow. You can also be explicit about
what other information you want. i.e. what deployers should be before/after you.

e.g.

  |    public MyDeployer()
  |    {
  |        super(MyMetaData.class);
  |        setInputs(SomeOtherMetaData1.class, SomeOtherMetaData2.class);
  |        setOutputs(MyOutput.class);
  |    }
  | 

You can see this in the DEBUG where it shows the calcualted ordering
and input/outputs, e.g.

  | 2007-06-28 14:34:27,112 DEBUG [org.jboss.deployers.plugins.deployers.DeployersImpl] Added deployer org.jboss.deployment.ClientDeployer at 39471b for stage Real
  | org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer at 121df2a{inputs=[org.jboss.beans.metadata.spi.BeanMetaData, org.jboss.kernel.spi.deployment.KernelDeplo
  | yment] outputs=[org.jboss.beans.metadata.spi.BeanMetaData]}
  | org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer at 1e46a68{inputs=[org.jboss.beans.metadata.spi.BeanMetaData] outputs=[]}
  | org.jboss.deployment.ClientDeployer at 39471b{inputs=[] outputs=[org.jboss.metadata.ClientMetaData]}
  | org.jboss.deployment.security.SecurityDeployer at 18b4ccb{inputs=[] outputs=[jboss.jacc]}
  | org.jboss.ejb.deployers.EjbDeployer at 5e5c15{inputs=[org.jboss.metadata.ApplicationMetaData] outputs=[org.jboss.system.metadata.ServiceMetaData]}
  | org.jboss.ejb3.deployers.AppClientScanningDeployer at 1743ff4{inputs=[org.jboss.ejb3.metamodel.ApplicationClientDD] outputs=[org.jboss.ejb3.metamodel.ApplicationClientDD]
  | }
  | org.jboss.ejb3.deployers.EJBRegistrationDeployer at d1afd3{inputs=[] outputs=[org.jboss.ejb3.Ejb3Deployment]}
  | org.jboss.ejb3.deployers.EJBStage2Deployer at 1ee2ea8{inputs=[org.jboss.ejb3.Ejb3Deployment] outputs=[]}
  | org.jboss.ejb3.deployers.Ejb3ClientDeployer at 182b9b5{inputs=[org.jboss.ejb3.metamodel.ApplicationClientDD] outputs=[org.jboss.ejb3.clientmodule.ClientENCInjectionContai
  | ner]}
  | org.jboss.resource.deployers.RARDeployer at f04dae{inputs=[org.jboss.resource.metadata.ConnectorMetaData] outputs=[org.jboss.system.metadata.ServiceMetaData]}
  | org.jboss.web.tomcat.service.deployers.TomcatDeployer at 133926{inputs=[org.jboss.metadata.WebMetaData] outputs=[org.jboss.system.metadata.ServiceMetaData]}
  | org.jboss.system.deployers.ServiceDeploymentDeployer at 1b7c76{inputs=[org.jboss.system.metadata.ServiceMetaData, org.jboss.system.metadata.ServiceDeployment] outputs=[or
  | g.jboss.system.metadata.ServiceMetaData]}
  | org.jboss.system.deployers.ServiceDeployer at 147e668{inputs=[org.jboss.system.metadata.ServiceMetaData] outputs=[]}
  | 

You'll notice the Service deployer is after many of the other deployers that create
ServiceMetaData (even though it was one of the first deployers deployed).

NOTE: The old relativeOrder still exists, but it is probably not as a good a way
to determine ordering.

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

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



More information about the jboss-dev-forums mailing list