Module aeonics.boot
Package aeonics

Class Protocols

  • All Implemented Interfaces:
    java.net.URLStreamHandlerFactory

    public class Protocols
    extends java.lang.Object
    implements java.net.URLStreamHandlerFactory
    This class can be used to register multiple protocol schemes usable via the URL class. This is because an application can only call URL.setURLStreamHandlerFactory(URLStreamHandlerFactory) once which is not compatible with a modular system that needs to register multiple protocols.
    • Constructor Summary

      Constructors 
      Constructor Description
      Protocols()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.URLStreamHandler createURLStreamHandler​(java.lang.String protocol)  
      static void register​(java.lang.String protocol, java.net.URLStreamHandler handler)
      Registers a new protocol scheme
      static void unregister​(java.lang.String protocol)
      Unregisters a protocol scheme
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Protocols

        public Protocols()
    • Method Detail

      • createURLStreamHandler

        public java.net.URLStreamHandler createURLStreamHandler​(java.lang.String protocol)
        Specified by:
        createURLStreamHandler in interface java.net.URLStreamHandlerFactory
      • register

        public static void register​(java.lang.String protocol,
                                    java.net.URLStreamHandler handler)
        Registers a new protocol scheme
        Parameters:
        protocol - the protocol name (i.e.: for "http://" the protocol is "http")
        handler - the URLStreamHandler to handle the protocol
      • unregister

        public static void unregister​(java.lang.String protocol)
        Unregisters a protocol scheme
        Parameters:
        protocol - the protocol name (i.e.: for "http://" the protocol is "http")