The question was: how I must use Deployer in JBoss5 (6) for sort and filter subdeployments?
In case you missed this article, a bit more info on how MC' VDF works:
* http://java.dzone.com/articles/jboss-microcontainer-virtual-deployment-framework
To answer the question, you can do this:
(a) use jboss-structure.xml to define a deployment comparator per (sub)deployment
* http://community.jboss.org/wiki/JBoss5custommetadatafiles
A down side of this is that you then have to be explicit about all things; metadata locations, classpath, ...
(b) you can add a deployer that dynamically/runtime sets relative order of subdeployments
* see DeploymentUnitExt::changeRelativeOrder
(c) set global comparator in deployers.xml for MainDeployerImpl
* <property name="comparator"><inject bean="topContextComparator"/></property>