Skip to content

Commit

Permalink
Fixes small exception on shutdown when conducting tests
Browse files Browse the repository at this point in the history
* When shutting down after tests, the dqp plugin can throw the 'programming
  error' exception produced by the DefaultServerProvider. The ServerCore
  can shutdown prior to the dqp plugin hence is no longer initialised.

* Only if the ServerCore is initialised is it necessary to remove the
  listeners from the server instances.
  • Loading branch information
Paul Richardson committed Oct 22, 2013
1 parent eb71f0b commit f97e748
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -297,8 +297,11 @@ public void notifyAdd(ModelWorkspaceNotification notification) {
*/
@Override
public void stop( final BundleContext context ) throws Exception {
getServersProvider().removeServerStateListener(TeiidParentServerListener.getInstance());
getServersProvider().removeServerLifecycleListener(TeiidParentServerListener.getInstance());
if (getServersProvider().isInitialised()) {
// If server is no longer initialised then no need to remove the listeners
getServersProvider().removeServerStateListener(TeiidParentServerListener.getInstance());
getServersProvider().removeServerLifecycleListener(TeiidParentServerListener.getInstance());
}

try {
if (getServerManager() != null) {
Expand Down

0 comments on commit f97e748

Please sign in to comment.