[jboss-dev-forums] [Deployers on JBoss (Deployers/JBoss)] - Re: jee module's alt-dd
alex.loubyansky@jboss.com
do-not-reply at jboss.com
Fri Apr 4 06:07:09 EDT 2008
I am trying to make it work. I don't see how I can add an attachment in the EARStructure. Instead, I am doing this in the AppParsingDeployer. I override the parse(..) method like (for now just for ejb)
protected EarMetaData parse(VFSDeploymentUnit unit, VirtualFile file, EarMetaData root) throws Exception
| {
| VirtualFile earRoot = file.getParent().getParent();
| EarMetaData earMetaData = super.parse(unit, file, root);
| ModulesMetaData modules = earMetaData.getModules();
| if(modules != null && modules.size() > 0)
| {
| for(ModuleMetaData module : modules)
| {
| String alternativeDD = module.getAlternativeDD();
| if(alternativeDD != null && module.getType() == ModuleType.Ejb)
| {
| VirtualFile altDDFile = earRoot.getChild(alternativeDD);
| unit.addAttachment("ejb.altDD", altDDFile);
| }
| }
| }
| return earMetaData;
| }
Then in the EjbParsingDeployer in the init(..)
protected void init(VFSDeploymentUnit unit, EjbJarMetaData metaData, VirtualFile file) throws Exception
| {
| VFSDeploymentUnit earUnit = unit.getParent();
| if(earUnit != null)
| {
| VirtualFile altDD = (VirtualFile) earUnit.getAttachment("ejb.altDD");
| if(altDD != null)
| file = altDD;
| }
| super.init(unit, metaData, file);
| }
Am I getting it right?
About the AltDD interface being in the deployers project. If metadata classes are going to implement it it would make the metadata project depend on deployers. Which doesn't seem to be a good idea to me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4141600#4141600
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4141600
More information about the jboss-dev-forums
mailing list