incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r905310 - /sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicRepositoryClassLoader.java
Date Mon, 01 Feb 2010 15:38:28 GMT
Author: cziegeler
Date: Mon Feb  1 15:38:27 2010
New Revision: 905310

URL: http://svn.apache.org/viewvc?rev=905310&view=rev
Log:
Check session before unregistering listeners

Modified:
    sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicRepositoryClassLoader.java

Modified: sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicRepositoryClassLoader.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicRepositoryClassLoader.java?rev=905310&r1=905309&r2=905310&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicRepositoryClassLoader.java
(original)
+++ sling/trunk/bundles/jcr/classloader/src/main/java/org/apache/sling/jcr/classloader/internal/DynamicRepositoryClassLoader.java
Mon Feb  1 15:38:27 2010
@@ -837,14 +837,17 @@
     private final void unregisterListeners() {
         log.debug("unregisterListeners: Deregistering from the observation service");
         if ( this.proxyListeners != null ) {
-            for(final EventListener listener : this.proxyListeners) {
-                if ( listener != null ) {
-                    try {
-                        final ObservationManager om = session.getWorkspace().getObservationManager();
-                        om.removeEventListener(listener);
-                    } catch (RepositoryException re) {
-                        log.error("unregisterListener: Cannot unregister " +
-                            this + " from observation manager", re);
+            // check session first!
+            if ( session.isLive() ) {
+                for(final EventListener listener : this.proxyListeners) {
+                    if ( listener != null ) {
+                        try {
+                            final ObservationManager om = session.getWorkspace().getObservationManager();
+                            om.removeEventListener(listener);
+                        } catch (RepositoryException re) {
+                            log.error("unregisterListener: Cannot unregister " +
+                                this + " from observation manager", re);
+                        }
                     }
                 }
             }



Mime
View raw message