Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-5885

Ability to add custom java url protocol handler

    XMLWordPrintable

Details

    Description

      Looking in the source code for org.jboss.system.server.ServerImpl [1]

      • this class is setting the URLStreamHandlerFactory and also calling preload and specifying the java.protocol.hanlder.pkgs.

      URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory());

      // Preload JBoss URL handlers
      URLStreamHandlerFactory.preload()
      ...
      System.setProperty("java.protocol.handler.pkgs", handlerPkgs);

      So it looks like there isn't a way to change the URLStreamHandlerFactory that is used and the instance of URLStreamHandlerFactory created is not accessible to add new protocols.

      Is there anything I'm missing, it looks like this should be a feature, I've found a few posts on the net mentioning other app servers allow you to specify the Factory class to use.

      The exception is:
      java.net.MalformedURLException: unknown protocol: classpath

      [1] http://anonsvn.jboss.org/repos/jbossas/tags/JBPAPP_4_3_0_GA_CP08/system/src/main/org/jboss/system/server/ServerImpl.java
      [2] http://anonsvn.jboss.org/repos/common/common-core/tags/jboss-common-core-2.0.4.GA/src/main/java/org/jboss/net/protocol/URLStreamHandlerFactory.java
      [3] http://community.jboss.org/message/288238?tstart=0

      Attachments

        Issue Links

          Activity

            People

              rhn-support-jawilson Jimmy Wilson
              rhn-support-bmaxwell Brad Maxwell
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: