[jboss-jira] [JBoss JIRA] Commented: (JBDEPLOY-4) Parsing more than one file
Ales Justin (JIRA)
jira-events at lists.jboss.org
Mon Mar 31 09:39:40 EDT 2008
[ http://jira.jboss.com/jira/browse/JBDEPLOY-4?page=comments#action_12405895 ]
Ales Justin commented on JBDEPLOY-4:
------------------------------------
This default handling has been added to deployers that use suffix to match metadata files.
protected T handleMultipleFiles(VFSDeploymentUnit unit, T root, List<VirtualFile> files) throws Exception
{
if (allowsMultipleFiles(files) == false)
throw new IllegalArgumentException("Multiple matching files not allowed: " + files);
for (VirtualFile file : files)
{
T result = parse(unit, file, root);
if (result != null)
{
init(unit, result, file);
unit.addAttachment(file.toURL().toString(), result, getOutput());
}
}
return null;
}
By default we still fail.
Unless explicitly allowed, meaning we have deployers down the chain that understand these new attachments.
> Parsing more than one file
> --------------------------
>
> Key: JBDEPLOY-4
> URL: http://jira.jboss.com/jira/browse/JBDEPLOY-4
> Project: JBoss Deployers
> Issue Type: Task
> Components: parsing
> Affects Versions: JBDEPLOY-2.0.0.Beta11
> Reporter: Adrian Brock
> Assigned To: Ales Justin
> Fix For: JBDEPLOY-2.0.0.CR1
>
>
> The AbstractVFSParser has the following limitiation:
> @Override
> protected T parse(DeploymentUnit unit, String name, String suffix, T root) throws Exception
> {
> // Should we include the deployment
> // The infrastructure will only check leafs anyway so no need to check here
> if (name == null && isIncludeDeploymentFile())
> name = unit.getName();
>
> // Try to find the metadata
> VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
> List<VirtualFile> files = vfsDeploymentUnit.getMetaDataFiles(name, suffix);
> if (files.size() == 0)
> return null;
>
> // TODO remove this limitation
> if (files.size() > 1)
> throw new DeploymentException("Only one file is allowed, found=" + files);
> VirtualFile file = files.get(0);
> This is really also related to the "reparse" that is done for ejb-jar.xml/jboss.xml and [jboss-]web.xml
> There should be parsing deployers that know how to parse multiple files into one object model.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list