[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-27 Thread alesj
Sure, afaic there shouldn't be any problems.

Or you can wait for me to do it,
as I have to port the 5_x changes anyway - probably the following week.

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226715
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-27 Thread alessio.sold...@jboss.com
Thanks Ales; btw I see you moved jboss AS Branch_5_x to using the 2.0.6.GA 
deployers, can we do the same for AS trunk?

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226710
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-27 Thread alesj
This is now already in 2.0.6.GA Deployers. ;-)

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226580
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread beve
anonymous wrote : You can definitely do what you posted (except for a little 
error --> WEB-INF in path :-)),
  | but it's a bit unpractical - you would have to hard code that into a 
deployer.
I agree and that is great if you can add this to the VFSDeploymentUnit. 

Thanks for this! :)

/Daniel 

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226542
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread alesj
Not really. :-)

You can definitely do what you posted (except for a little error --> WEB-INF in 
path :-)),
but it's a bit unpractical - you would have to hard code that into a deployer.

Where if you do this via filter, directly on metadata locations,
you can easily extend your filter, push it to deployer, and you're done.





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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226518
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread beve
anonymous wrote : Hence only "you" know what you wanna scan as sub-dir
Ah, I think I understand what you mean. I'm not sure if it's a convention to 
put wsdl files in WEB/wsdl but if so then the JBossWS could:


  | VirtualFile metaDataFile = context.getMetaDataFile("/WEB-INF/wsdl");
  | List children = metaDataFile.getChildren();
  | 
And they could specify a filter if they are only interested in ".wsdl" files.
Is that what you meant?

Thanks,

/Daniel


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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226501
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread alesj
I'll add this to VFSDeploymentUnit:

  |/**
  | * 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 getMetaDataFiles(VirtualFileFilter filter);
  | 

This will enable you to easily get what you're looking for.
e.g. if filter is instance of VirtualFileFilterWithAttributes it will also 
recurse into metadata locations

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226498
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread beve
anonymous wrote : Why would you want to recurse into a metadata location?
  | I don't think that's a "natural" behavior. 
Well this is not the reason we are using it for right now but there might be 
the need to have a META-INF/services directory containing Service Provider 
coniguration files and you might want to include it in the search. 





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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226493
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread alesj
"beve" wrote : In our case the file we are looking of is in a subdirectory and 
I think this is the problem. 
  | getMetaDataFiles does not look for files recursively in all metadata 
locations. 
  | 
Why would you want to recurse into a metadata location?
I don't think that's a "natural" behavior.

Looking up too much might lead to weird behavior.
e.g. someone might have META-INF/backup/copy-my-jboss-beans.xml
Hence only "you" know what you wanna scan as sub-dir,
where as META-INF is by the spec.

"beve" wrote : 
  | This might be by design but is there a way for us to accomplish this?
  | 
You can add all the possible metadata sub-directories as metadata locations.


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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226484
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread beve
In our case the file we are looking of is in a subdirectory and I think this is 
the problem. 
getMetaDataFiles does not look for files recursively in all metadata locations. 

// Look in the meta data location
  | List results = new ArrayList();
  | for (VirtualFile location : metaDataLocations)
  | {
  |  List result = location.getChildren(new 
MetaDataMatchFilter(name, suffix));
  |  if (result != null && result.isEmpty() == false)
  |  {
  | ...
There is another constructor for MetaDataMatcher that takes VisitorAttributes. 
When using the constructor with name and suffix the attributes will be set to 
VisitorAttributes.LEAVES_ONLY:
  | if (attributes == null)
  |  attributes = VisitorAttributes.LEAVES_ONLY;
Using the second constructor and setting VisitorAttributes.RECURSE_LEAVES_ONLY 
does what we want:

  | List results = new ArrayList();
  | for (VirtualFile location : metaDataLocations)
  | {
  |  List result = location.getChildren(new 
MetaDataMatchFilter(name, suffix, VisitorAttributes.RECURSE_LEAVES_ONLY));
  |  if (result != null && result.isEmpty() == false)
  |  {
  | ...
This might be by design but is there a way for us to accomplish this?

Thanks,

/Daniel

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226477
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread beve
anonymous wrote : First of all you shouldn't code against 
(VFS)DeploymentContext, as that is considered impl detail.
  | It's the (VFS)DeploymentUnit which is the user "face" of deployment's 
server side. 
Sorry, the actual code only uses the VFSDeploymentUnit and does not directly 
access the DeploymentContext. Only this test case does to show that 
getMetaDataFiles does not return all the meta data files when used with the "" 
suffix. 

I'll debug this and report back my findings.

Thanks,

/Daniel

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226447
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Microcontainer] - Re: Retrieve all metadata from a deployment unit.

2009-04-24 Thread alesj
First of all you shouldn't code against (VFS)DeploymentContext, as that is 
considered impl detail.
It's the (VFS)DeploymentUnit which is the user "face" of deployment's server 
side.

And looking at the the AbstractVFSDeploymentContext::getMetaDataFiles(String 
name, String suffix),
I don't see why your test doesn't pick up all metadata files.

As this filter should match your "" suffix.

  |public boolean accepts(VirtualFile file)
  |{
  |   String fileName = file.getName();
  |   if (name != null && fileName.equals(name))
  |  return true;
  |   if (suffix != null)
  |  return fileName.endsWith(suffix);
  |   return false;
  |}
  | 

What does the debugging say?

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

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4226437
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user