Class ConnectorClassLoader

    • Method Detail

      • getInstance

        public static ConnectorClassLoader getInstance​(ClassLoader parent)
        Initializes this singleton with the given parent class loader if not already created.
        Parameters:
        parent - parent class loader
        Returns:
        the instance
      • addResourceAdapter

        public void addResourceAdapter​(String rarName,
                                       String moduleDir)
        Adds the requested resource adapter to the ConnectorClassLoader. A ConnectorClassLoader is created with the moduleDir as its search path and this classloader is added to the classloader chain.
        Parameters:
        rarName - the resourceAdapter module name to add
        moduleDir - the directory location where the RAR contents are exploded
      • removeResourceAdapter

        public void removeResourceAdapter​(String moduleName)
        Removes the resource adapter's class loader from the classloader linked list
        Parameters:
        moduleName - the connector module that needs to be removed.
      • getClasspath

        public String getClasspath()
        Returns all the resources of the connector classloaders in the chain, concatenated to a classpath string.

        Notice that this method is called by the setClassPath() method of org.apache.catalina.loader.WebappLoader, since the ConnectorClassLoader does not extend off of URLClassLoader.

        Overrides:
        getClasspath in class ASURLClassLoader
        Returns:
        Classpath string containing all the resources of the connectors in the chain. An empty string if there exists no connectors in the chain.