[jboss-cvs] JBossAS SVN: r99160 - in projects/jboss-deployers/trunk: deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure and 4 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jan 8 08:58:06 EST 2010
Author: alesj
Date: 2010-01-08 08:58:04 -0500 (Fri, 08 Jan 2010)
New Revision: 99160
Added:
projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/MetaDataTypeFilter.java
Modified:
projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/deployer/AbstractVFSParsingDeployer.java
projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java
projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java
Log:
[JBDEPLOY-232]; diff between metadata types.
Copied: projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/MetaDataTypeFilter.java (from rev 99156, projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/MetaDataType.java)
===================================================================
--- projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/MetaDataTypeFilter.java (rev 0)
+++ projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/MetaDataTypeFilter.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.spi.structure;
+
+/**
+ * A metadata type filter
+ *
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface MetaDataTypeFilter
+{
+ /**
+ * Do we accept the type.
+ *
+ * @param type the current type to check
+ * @return true if we accept the type, false otherwise
+ */
+ boolean accepts(MetaDataType type);
+
+ public static final MetaDataTypeFilter DEFAULT = new MetaDataTypeFilter()
+ {
+ public boolean accepts(MetaDataType type)
+ {
+ return MetaDataType.DEFAULT == type;
+ }
+ };
+
+ public static final MetaDataTypeFilter ALL = new MetaDataTypeFilter()
+ {
+ public boolean accepts(MetaDataType type)
+ {
+ return true;
+ }
+ };
+}
\ No newline at end of file
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -33,6 +33,7 @@
import org.jboss.deployers.spi.structure.MetaDataEntry;
import org.jboss.deployers.spi.structure.MetaDataType;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
@@ -161,6 +162,14 @@
public List<VirtualFile> getMetaDataLocations()
{
+ return getMetaDataLocations(MetaDataTypeFilter.DEFAULT);
+ }
+
+ public List<VirtualFile> getMetaDataLocations(MetaDataTypeFilter filter)
+ {
+ if (filter == null)
+ throw new IllegalArgumentException("Null filter");
+
if (metaDataLocations == null || metaDataLocations.isEmpty())
{
return Collections.emptyList();
@@ -170,8 +179,11 @@
List<VirtualFile> result = new ArrayList<VirtualFile>();
for(Map.Entry<VirtualFile, MetaDataType> entry : metaDataLocations.entrySet())
{
- VirtualFile location = entry.getKey();
- result.add(location);
+ if (filter.accepts(entry.getValue()))
+ {
+ VirtualFile location = entry.getKey();
+ result.add(location);
+ }
}
return result;
}
@@ -201,8 +213,15 @@
public VirtualFile getMetaDataFile(String name)
{
+ return getMetaDataFile(name, MetaDataTypeFilter.DEFAULT);
+ }
+
+ public VirtualFile getMetaDataFile(String name, MetaDataTypeFilter filter)
+ {
if (name == null)
throw new IllegalArgumentException("Null name");
+ if (filter == null)
+ throw new IllegalArgumentException("Null filter");
try
{
// There isn't a metadata locations so let's see whether the root matches.
@@ -220,7 +239,7 @@
return null;
}
// Look in the meta data locations
- return searchMetaDataLocations(name);
+ return searchMetaDataLocations(name, filter);
}
catch (Exception e)
{
@@ -239,45 +258,71 @@
*/
protected VirtualFile searchMetaDataLocations(String name)
{
+ return searchMetaDataLocations(name, MetaDataTypeFilter.DEFAULT);
+ }
+
+ /**
+ * Search the metadata locations.
+ * In this impl the first one matching is returned.
+ *
+ * @param name the file name to find
+ * @param filter the metadata type filter
+ * @return found file or null if not found
+ */
+ protected VirtualFile searchMetaDataLocations(String name, MetaDataTypeFilter filter)
+ {
VirtualFile result = null;
for(Map.Entry<VirtualFile, MetaDataType> entry : metaDataLocations.entrySet())
{
- VirtualFile location = entry.getKey();
- try
+ if (filter.accepts(entry.getValue()))
{
- result = location.getChild(name);
- if (result != null)
+ VirtualFile location = entry.getKey();
+ try
{
- if (log.isTraceEnabled())
- log.trace("Found " + name + " in " + location.getName());
- deployed();
- break;
+ result = location.getChild(name);
+ if (result != null)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Found " + name + " in " + location.getName());
+ deployed();
+ break;
+ }
}
+ catch (IOException e)
+ {
+ log.debug("Search exception invocation for metafile " + name + " in " + location.getName() + ", reason: " + e);
+ }
}
- catch (IOException e)
- {
- log.debug("Search exception invocation for metafile " + name + " in " + location.getName() + ", reason: " + e);
- }
}
return result;
}
public List<VirtualFile> getMetaDataFiles(String name, String suffix)
{
+ return getMetaDataFiles(name, suffix, MetaDataTypeFilter.DEFAULT);
+ }
+
+ public List<VirtualFile> getMetaDataFiles(String name, String suffix, MetaDataTypeFilter mdtf)
+ {
if (name == null && suffix == null)
throw new IllegalArgumentException("Null name and suffix");
VirtualFileFilter filter = new MetaDataMatchFilter(name, suffix);
- return getMetaDataFiles(filter);
+ return getMetaDataFiles(filter, mdtf);
}
public List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter)
{
- if (filter == null)
+ return getMetaDataFiles(filter, MetaDataTypeFilter.DEFAULT);
+ }
+
+ public List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter, MetaDataTypeFilter mdtf)
+ {
+ if (filter == null || mdtf == null)
{
// we don't wanna guess what needs to be filtered
// if all is what you want, use your own ALL filter
- throw new IllegalArgumentException("Null filter");
+ throw new IllegalArgumentException("Null filter - VFS or MetaDataType: vfs=" + filter + ", mdt=" + mdtf);
}
try
@@ -301,14 +346,17 @@
List<VirtualFile> results = new ArrayList<VirtualFile>();
for(Map.Entry<VirtualFile, MetaDataType> entry : metaDataLocations.entrySet())
{
- VirtualFile location = entry.getKey();
- List<VirtualFile> result = location.getChildren(filter);
- if (result != null && result.isEmpty() == false)
+ if (mdtf.accepts(entry.getValue()))
{
- if (log.isTraceEnabled())
- log.trace("Found results with " + filter + " in " + location.getName());
- results.addAll(result);
- deployed();
+ VirtualFile location = entry.getKey();
+ List<VirtualFile> result = location.getChildren(filter);
+ if (result != null && result.isEmpty() == false)
+ {
+ if (log.isTraceEnabled())
+ log.trace("Found results with " + filter + " in " + location.getName());
+ results.addAll(result);
+ deployed();
+ }
}
}
return results;
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentResourceLoader;
@@ -65,16 +66,31 @@
return getDeploymentContext().getMetaDataFile(name);
}
+ public VirtualFile getMetaDataFile(String name, MetaDataTypeFilter filter)
+ {
+ return getDeploymentContext().getMetaDataFile(name, filter);
+ }
+
public List<VirtualFile> getMetaDataFiles(String name, String suffix)
{
return getDeploymentContext().getMetaDataFiles(name, suffix);
}
+ public List<VirtualFile> getMetaDataFiles(String name, String suffix, MetaDataTypeFilter filter)
+ {
+ return getDeploymentContext().getMetaDataFiles(name, suffix, filter);
+ }
+
public List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter)
{
return getDeploymentContext().getMetaDataFiles(filter);
}
+ public List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter, MetaDataTypeFilter mdtf)
+ {
+ return getDeploymentContext().getMetaDataFiles(filter, mdtf);
+ }
+
public void prependMetaDataLocation(VirtualFile... locations)
{
getDeploymentContext().prependMetaDataLocation(locations);
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/AbstractStructureTest.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -27,6 +27,7 @@
import java.util.List;
import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.structure.spi.DeploymentContext;
import org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl;
import org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder;
@@ -159,8 +160,13 @@
protected void assertMetaData(VFSDeploymentContext context, String metaDataPath) throws Exception
{
+ assertMetaData(context, metaDataPath, MetaDataTypeFilter.DEFAULT);
+ }
+
+ protected void assertMetaData(VFSDeploymentContext context, String metaDataPath, MetaDataTypeFilter filter) throws Exception
+ {
VirtualFile root = context.getRoot();
- List<VirtualFile> metaDataLocation = context.getMetaDataLocations();
+ List<VirtualFile> metaDataLocation = context.getMetaDataLocations(filter);
VirtualFile expected = root.findChild(metaDataPath);
assertNotNull(metaDataLocation);
assertEquals(1, metaDataLocation.size());
@@ -169,8 +175,13 @@
protected void assertMetaDatas(VFSDeploymentContext context, String... metaDataPath) throws Exception
{
+ assertMetaDatas(context, MetaDataTypeFilter.DEFAULT, metaDataPath);
+ }
+
+ protected void assertMetaDatas(VFSDeploymentContext context, MetaDataTypeFilter filter, String... metaDataPath) throws Exception
+ {
VirtualFile root = context.getRoot();
- List<VirtualFile> metaDataLocations = context.getMetaDataLocations();
+ List<VirtualFile> metaDataLocations = context.getMetaDataLocations(filter);
assertNotNull(metaDataLocations);
int i = 0;
for(String path : metaDataPath)
Modified: projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/explicit/test/DeclaredStructureUnitTestCase.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -24,6 +24,8 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.deployers.spi.structure.MetaDataType;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure;
import org.jboss.deployers.vfs.spi.client.VFSDeployment;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
@@ -83,8 +85,14 @@
public void testAlternative() throws Throwable
{
VFSDeploymentContext root = assertDeploy("/structure/explicit", "alt.jar");
- // Validate the root context info
- assertMetaDatas(root, "META-INF", "config");
- // TODO -- check alt usage
+ assertMetaData(root, "META-INF");
+ assertMetaDatas(root, MetaDataTypeFilter.ALL, "META-INF", "config");
+ assertMetaData(root, "config", new MetaDataTypeFilter()
+ {
+ public boolean accepts(MetaDataType type)
+ {
+ return MetaDataType.ALTERNATIVE == type;
+ }
+ });
}
}
Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/deployer/AbstractVFSParsingDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/deployer/AbstractVFSParsingDeployer.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/deployer/AbstractVFSParsingDeployer.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -32,6 +32,7 @@
import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.spi.deployer.helpers.AbstractParsingDeployerWithOutput;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.virtual.VirtualFile;
@@ -52,6 +53,9 @@
/** The allow multiple fiels flag */
private boolean allowMultipleFiles;
+ /** The metadata type filter */
+ private MetaDataTypeFilter filter = MetaDataTypeFilter.DEFAULT;
+
/**
* Create a new AbstractVFSParsingDeployer.
*
@@ -110,6 +114,21 @@
}
/**
+ * Get metadata type filter from unit - if deployer's filter is set to null.
+ *
+ * @param unit the deployment unit
+ * @return metadata type filter
+ */
+ protected MetaDataTypeFilter getMetaDataTypeFilter(DeploymentUnit unit)
+ {
+ if (filter != null)
+ return filter;
+
+ MetaDataTypeFilter mdtf = unit.getAttachment(MetaDataTypeFilter.class);
+ return mdtf != null ? mdtf : MetaDataTypeFilter.DEFAULT;
+ }
+
+ /**
* Open stream and validate if not null.
*
* @param file the virtual file
@@ -169,7 +188,7 @@
altMappingsMap.put(file.getName(), altExpectedClass);
}
if(checkMetaDataFile && file == null)
- file = unit.getMetaDataFile(originalName);
+ file = unit.getMetaDataFile(originalName, getMetaDataTypeFilter(unit));
return file;
}
@@ -250,7 +269,7 @@
return parseAndInit(vfsDeploymentUnit, file, root, true);
// try all name+suffix matches
- List<VirtualFile> files = vfsDeploymentUnit.getMetaDataFiles(name, suffix);
+ List<VirtualFile> files = vfsDeploymentUnit.getMetaDataFiles(name, suffix, getMetaDataTypeFilter(unit));
switch (files.size())
{
case 0 :
@@ -320,7 +339,7 @@
VirtualFile file = getMetadataFile(vfsDeploymentUnit, matchFileToClass(unit, name), name, false);
if (file == null)
{
- List<VirtualFile> matched = vfsDeploymentUnit.getMetaDataFiles(name, suffix);
+ List<VirtualFile> matched = vfsDeploymentUnit.getMetaDataFiles(name, suffix, getMetaDataTypeFilter(unit));
if (matched != null && matched.isEmpty() == false)
files.addAll(matched);
else
@@ -432,4 +451,14 @@
{
this.allowMultipleFiles = allowMultipleFiles;
}
+
+ /**
+ * Set metadata type filter.
+ *
+ * @param filter the metadata type filter
+ */
+ public void setFilter(MetaDataTypeFilter filter)
+ {
+ this.filter = filter;
+ }
}
Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -24,6 +24,7 @@
import java.util.List;
import org.jboss.deployers.spi.structure.MetaDataEntry;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.structure.spi.DeploymentContext;
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.VirtualFileFilter;
@@ -59,6 +60,14 @@
List<VirtualFile> getMetaDataLocations();
/**
+ * Get the meta data locations
+ *
+ * @param filter the metadata type filter
+ * @return the meta data locations
+ */
+ List<VirtualFile> getMetaDataLocations(MetaDataTypeFilter filter);
+
+ /**
* Set the meta data locations
*
* @param locations the meta data location
@@ -66,8 +75,9 @@
void setMetaDataLocations(List<VirtualFile> locations);
/**
- * Gets a metadata file
- *
+ * Gets a metadata file. This is a file located under the deployment metadata
+ * context(s).
+ *
* @param name the name to exactly match
* @return the virtual file or null if not found
* @throws IllegalArgumentException for a null name
@@ -75,9 +85,20 @@
VirtualFile getMetaDataFile(String name);
/**
- * Gets metadata files for this deployment
- *
+ * Gets a metadata file. This is a file located under the deployment metadata
+ * context(s).
+ *
* @param name the name to exactly match
+ * @param filter the metadata type filter
+ * @return the virtual file or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ VirtualFile getMetaDataFile(String name, MetaDataTypeFilter filter);
+
+ /**
+ * Gets the metadata files for this deployment unit
+ *
+ * @param name the name to exactly match
* @param suffix the suffix to partially match
* @return the virtual files that match
* @throws IllegalArgumentException if both the name and suffix are null
@@ -87,6 +108,17 @@
/**
* Gets the metadata files for this deployment unit
*
+ * @param name the name to exactly match
+ * @param suffix the suffix to partially match
+ * @param filter the metadata type filter
+ * @return the virtual files that match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ List<VirtualFile> getMetaDataFiles(String name, String suffix, MetaDataTypeFilter filter);
+
+ /**
+ * Gets the metadata files for this deployment unit
+ *
* @param filter the file filter
* @return the virtual files that match
* @throws IllegalArgumentException if both the name and suffix are null
@@ -94,6 +126,16 @@
List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter);
/**
+ * Gets the metadata files for this deployment unit
+ *
+ * @param filter the file filter
+ * @param mdtf the metadata type filter
+ * @return the virtual files that match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter, MetaDataTypeFilter mdtf);
+
+ /**
* Prepend metadata file locations.
*
* @param locations the locations
Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java 2010-01-08 13:36:28 UTC (rev 99159)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java 2010-01-08 13:58:04 UTC (rev 99160)
@@ -23,6 +23,7 @@
import java.util.List;
+import org.jboss.deployers.spi.structure.MetaDataTypeFilter;
import org.jboss.deployers.structure.spi.DeploymentUnit;
import org.jboss.virtual.VirtualFile;
import org.jboss.virtual.VirtualFileFilter;
@@ -47,6 +48,17 @@
VirtualFile getMetaDataFile(String name);
/**
+ * Gets a metadata file. This is a file located under the deployment metadata
+ * context(s).
+ *
+ * @param name the name to exactly match
+ * @param filter the metadata type filter
+ * @return the virtual file or null if not found
+ * @throws IllegalArgumentException for a null name
+ */
+ VirtualFile getMetaDataFile(String name, MetaDataTypeFilter filter);
+
+ /**
* Gets the metadata files for this deployment unit
*
* @param name the name to exactly match
@@ -55,15 +67,36 @@
* @throws IllegalArgumentException if both the name and suffix are null
*/
List<VirtualFile> getMetaDataFiles(String name, String suffix);
-
+
/**
* Gets the metadata files for this deployment unit
*
+ * @param name the name to exactly match
+ * @param suffix the suffix to partially match
+ * @param filter the metadata type filter
+ * @return the virtual files that match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ List<VirtualFile> getMetaDataFiles(String name, String suffix, MetaDataTypeFilter filter);
+
+ /**
+ * Gets the metadata files for this deployment unit
+ *
* @param filter the file filter
* @return the virtual files that match
* @throws IllegalArgumentException if both the name and suffix are null
*/
List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter);
+
+ /**
+ * Gets the metadata files for this deployment unit
+ *
+ * @param filter the file filter
+ * @param mdtf the metadata type filter
+ * @return the virtual files that match
+ * @throws IllegalArgumentException if both the name and suffix are null
+ */
+ List<VirtualFile> getMetaDataFiles(VirtualFileFilter filter, MetaDataTypeFilter mdtf);
/**
* Prepend metadata file locations.
More information about the jboss-cvs-commits
mailing list