[jboss-dev-forums] [Design of JBoss Deployment Framework] - Re: Russian doll packaging in arbitrary directories - JBAS-5

alesj do-not-reply at jboss.com
Sat Sep 20 16:08:01 EDT 2008


"alesj" wrote : I'll look into it a bit more. :-)
I've managed to see/find the problem.
Hacking this dir structure deployer deploys that 'broken' sar deployment:

  | public class DirectoryStructure extends AbstractVFSStructureDeployer
  | {
  |    public DirectoryStructure()
  |    {
  |       setRelativeOrder(Integer.MAX_VALUE);
  |    }
  | 
  |    public boolean determineStructure(StructureContext context) throws DeploymentException
  |    {
  |       try
  |       {
  |          VirtualFile file = context.getFile();
  |          // jar structure should already handle top level dirs
  |          if (context.isTopLevel() == false && isLeaf(file) == false && isMetadataPath(context) == false)
  |          {
  |             List<VirtualFile> children = file.getChildren();
  |             if (children != null && children.isEmpty() == false)
  |             {
  |                VFSStructuralDeployers structuralDeployers = context.getDeployers();
  | 
  |                // get top
  |                while (context.getParentContext() != null)
  |                   context = context.getParentContext();
  | 
  |                for (VirtualFile child : children)
  |                   structuralDeployers.determineStructure(child, context);
  |             }
  |          }
  |          return false;
  |       }
  |       catch (Exception e)
  |       {
  |          throw DeploymentException.rethrowAsDeploymentException("Error determining structure.", e);
  |       }
  |    }
  | 
  |    /**
  |     * Is the current context already part of metadata path.
  |     *
  |     * @param context the current structure context
  |     * @return true if already part of parent's context metadata path
  |     */
  |    protected boolean isMetadataPath(StructureContext context)
  |    {
  |       String relativePath = AbstractStructureDeployer.getRelativePath(context.getParent(), context.getFile());
  |       return "META-INF".equalsIgnoreCase(relativePath) || "WEB-INF".equalsIgnoreCase(relativePath);
  |    }
  | }
  | 

But it looks too much of a hack. :-(
e.g. dunno how it would handle that top structure context search in some ear deployment

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

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



More information about the jboss-dev-forums mailing list