[jboss-dev-forums] [JBoss AS 7 Development] - Re: URL-Protocol Handler doesn't work
Daniel Straub
do-not-reply at jboss.com
Wed Feb 8 07:18:38 EST 2012
Daniel Straub [https://community.jboss.org/people/dastraub] created the discussion
"Re: URL-Protocol Handler doesn't work"
To view the discussion, visit: https://community.jboss.org/message/715180#715180
--------------------------------------------------------------
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 ?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/715180#715180]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20120208/ea0c970d/attachment.html
More information about the jboss-dev-forums
mailing list