Hi David
now I came back to this thread (because we're porting a large application to AS 7), and I use the following solution :
In a self developed extension we do some stuff during the deployment, and here also we add our URLStreamHandlerFactory :
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
URL url = module.getExportedResource("META-INF/services/java.net.URLStreamHandlerFactory");
if (url != null) {
log.info("registerURLStreamHandlerFactoryModule " + module.getIdentifier());
Module.registerURLStreamHandlerFactoryModule(module);
}
}
Ok, thar solves the half part.
Unfortunatly, there is no method for unregister this module during undeploy.
Is it possible to add this method to the Module ?