[jboss-cvs] JBossAS SVN: r78728 - in projects/demos/microcontainer/trunk/jmx/src/main: resources/META-INF and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sat Sep 20 16:07:39 EDT 2008
Author: alesj
Date: 2008-09-20 16:07:39 -0400 (Sat, 20 Sep 2008)
New Revision: 78728
Modified:
projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/deployers/legacy/DirectoryStructure.java
projects/demos/microcontainer/trunk/jmx/src/main/resources/META-INF/system-jmx-beans.xml
Log:
[JBAS-5900]; initial dir hack.
Modified: projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/deployers/legacy/DirectoryStructure.java
===================================================================
--- projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/deployers/legacy/DirectoryStructure.java 2008-09-20 08:24:45 UTC (rev 78727)
+++ projects/demos/microcontainer/trunk/jmx/src/main/java/org/jboss/demos/deployers/legacy/DirectoryStructure.java 2008-09-20 20:07:39 UTC (rev 78728)
@@ -21,9 +21,14 @@
*/
package org.jboss.demos.deployers.legacy;
+import java.util.List;
+
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.virtual.VirtualFile;
/**
* Legacy directory structure.
@@ -43,10 +48,22 @@
{
try
{
+ VirtualFile file = context.getFile();
// jar structure should already handle top level dirs
- if (context.isTopLevel() == false && isLeaf(context.getFile()) == false)
+ if (context.isTopLevel() == false && isLeaf(file) == false && isMetadataPath(context) == false)
{
- addAllChildren(context);
+ 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;
}
@@ -55,4 +72,16 @@
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);
+ }
}
Modified: projects/demos/microcontainer/trunk/jmx/src/main/resources/META-INF/system-jmx-beans.xml
===================================================================
--- projects/demos/microcontainer/trunk/jmx/src/main/resources/META-INF/system-jmx-beans.xml 2008-09-20 08:24:45 UTC (rev 78727)
+++ projects/demos/microcontainer/trunk/jmx/src/main/resources/META-INF/system-jmx-beans.xml 2008-09-20 20:07:39 UTC (rev 78728)
@@ -18,6 +18,6 @@
<bean name="HackClassLoaderMetaDataDeployer" class="org.jboss.system.deployers.HackClassloaderMetaDataDeployer"/>
<!-- Legacy sar behavior -->
- <!--<bean name="DirectoryStructure" class="org.jboss.demos.deployers.legacy.DirectoryStructure"/>-->
+ <bean name="DirectoryStructure" class="org.jboss.demos.deployers.legacy.DirectoryStructure"/>
</deployment>
More information about the jboss-cvs-commits
mailing list