You need to write a new (sub)deployer, either by extending org.jboss.deployment.SubDeployerSupport or org.jboss.deployment.SimpleSubDeployerSupport
Try listDeployers (or something like that) from the jmx-console on the MainDeployer to find out the names/classes of the various registered subdeployers, then look at their code to understand what they are supposed to do.
Thanks Dimitris, this has given me a good starting point. Subdeployers is the keyword I was missing and calling it a custom deployer.
I am hoping my question about the classloading will be solved through sub deployers itself; will post results.