org.rhq.plugins.database
Class DatabasePluginLifecycleListener

java.lang.Object
  extended by org.rhq.plugins.database.DatabasePluginLifecycleListener
All Implemented Interfaces:
PluginLifecycleListener

public class DatabasePluginLifecycleListener
extends java.lang.Object
implements PluginLifecycleListener

This is a plugin lifecycle listener object for database plugins. It is used to deregister any JDBC drivers that happened to have been cached by the plugin. This is needed to avoid leaking perm gen memory when a plugin's classloader is destroyed because java.sql.DriverManager will maintain references that prevent the plugin's classloader and its resources from being garbaged collected. All database plugins should have their own class that does this but due to the odd way java.sql.DriverManager caches drivers, plugins that extend the database plugin cannot simply reuse or subclass this object.

Author:
John Mazzitelli

Constructor Summary
DatabasePluginLifecycleListener()
           
 
Method Summary
 void initialize(PluginContext context)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabasePluginLifecycleListener

public DatabasePluginLifecycleListener()
Method Detail

initialize

public void initialize(PluginContext context)
                throws java.lang.Exception
Specified by:
initialize in interface PluginLifecycleListener
Throws:
java.lang.Exception

shutdown

public void shutdown()
Specified by:
shutdown in interface PluginLifecycleListener


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.