Class DriverManagerAdapterProcessor

  • All Implemented Interfaces:
    org.jboss.as.server.deployment.DeploymentUnitProcessor

    public class DriverManagerAdapterProcessor
    extends Object
    implements org.jboss.as.server.deployment.DeploymentUnitProcessor
    Author:
    Tomasz Adamski

    https://issues.redhat.com/browse/WFLY-14114

    This is a hack that allows us to get access to Driver registered by the driver code. Those objects are created by the driver code and registered in DriverManager. Driver objects are not guaranteed to be deregistered which leads to leaks. DriverManager allows for obtaining the list of drivers, and deregistering a driver but only in a give classloading context. As a result, connector module can not neither list or deregister drivers from a deployed driver module.

    To work this around, this hack modifies driver's module by injecting DriverManagerAdapter class to it. Because @DriverManagerAdapter is loaded by driver module it allows to obtain and deregister the drivers.

    • Constructor Detail

      • DriverManagerAdapterProcessor

        public DriverManagerAdapterProcessor()
    • Method Detail

      • deploy

        public void deploy​(org.jboss.as.server.deployment.DeploymentPhaseContext phaseContext)
                    throws org.jboss.as.server.deployment.DeploymentUnitProcessingException
        Specified by:
        deploy in interface org.jboss.as.server.deployment.DeploymentUnitProcessor
        Throws:
        org.jboss.as.server.deployment.DeploymentUnitProcessingException