"jaikiran" wrote : 
  | So would that mean, the attachment generated by a component deployer is of 
no pratical use to non-component deployers?
  | 
No, that's exactly what I'm trying to explain.
Component deployers should only consume attachments,
not create/generate them.

"jaikiran" wrote : 
  | So would this be a clean way of doing things in a component deployer:
  | 
  | 
  |   | public void deploy(DeploymentUnit unit) throws DeploymentException
  |   |    {
  |   |       logger.info("Deploying unit : " + unit);
  |   | 
  |   |         // Am i deploying a component?
  |   |         if (unit.isComponent())
  |   |         {
  |   |                 // yes, i am deploying a component
  |   |                 ...
  |   |                 // should my attachments be visible to non-component 
deployers?
  |   |                 if (shouldMyAttachmentsBeVisibleToAll())
  |   |                 {
  |   |                         // should be visible to all, so add to parent
  |   |                         
unit.getParent().addAttachment(something,someotherthing);
  |   |                 } 
  |   |                 else
  |   |                 {
  |   |                         // only to component deployers
  |   |                         unit.addAttachment(something,someotherthing);
  |   |                 }               
  |   | 
  |   |         }
  |   | 
  |   |    }
  | 
  | 
The moment you're hacking with getParent::addAtachment you know 
there is something wrong with how you're doing it.
I know we have something like that in our JPA deployers. :-(

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215187
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to