org.rhq.plugins.database
Class DatabasePluginLifecycleListener
java.lang.Object
org.rhq.plugins.database.DatabasePluginLifecycleListener
- All Implemented Interfaces:
- PluginLifecycleListener
public class DatabasePluginLifecycleListener
- extends 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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabasePluginLifecycleListener
public DatabasePluginLifecycleListener()
initialize
public void initialize(PluginContext context)
throws Exception
- Specified by:
initialize in interface PluginLifecycleListener
- Throws:
Exception
shutdown
public void shutdown()
- Specified by:
shutdown in interface PluginLifecycleListener
Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.