ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [1/2] incubator-ignite git commit: GG-9614 refactoring cleanup
Date Tue, 12 May 2015 12:43:36 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-gg-9614 e2a0a41b8 -> 1359de6fc


GG-9614 refactoring cleanup


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/5799f639
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/5799f639
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/5799f639

Branch: refs/heads/ignite-gg-9614
Commit: 5799f639574d2c21bc5f6ae1c90b340def68439e
Parents: e2a0a41
Author: ptupitsyn <ptupitsyn@gridgain.com>
Authored: Tue May 12 13:22:59 2015 +0300
Committer: ptupitsyn <ptupitsyn@gridgain.com>
Committed: Tue May 12 13:22:59 2015 +0300

----------------------------------------------------------------------
 .../eventstorage/GridEventStorageManager.java   |  8 ++++++
 .../GridLifecycleAwareLocalEventListener.java   | 28 ++++++++++++++++++++
 .../eventstorage/GridLocalEventListener.java    |  1 +
 3 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5799f639/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
index 6ebe480..6683af6 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridEventStorageManager.java
@@ -653,6 +653,14 @@ public class GridEventStorageManager extends GridManagerAdapter<EventStorageSpi>
             }
         }
 
+        if (lsnr instanceof UserListenerWrapper)
+        {
+            UserListenerWrapper wrapper = (UserListenerWrapper)lsnr;
+
+            if (wrapper.listener() instanceof GridLifecycleAwareLocalEventListener)
+                ((GridLifecycleAwareLocalEventListener)wrapper.listener()).close();
+        }
+
         return found;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5799f639/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLifecycleAwareLocalEventListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLifecycleAwareLocalEventListener.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLifecycleAwareLocalEventListener.java
new file mode 100644
index 0000000..31db6ac
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLifecycleAwareLocalEventListener.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.managers.eventstorage;
+
+/**
+ * Special version of listener for events with close callbacks.
+ */
+public interface GridLifecycleAwareLocalEventListener {
+    /**
+     * Closes the listener.
+     */
+    public void close();
+}

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/5799f639/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLocalEventListener.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLocalEventListener.java
b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLocalEventListener.java
index 137b7b3..d75086a 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLocalEventListener.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/eventstorage/GridLocalEventListener.java
@@ -37,3 +37,4 @@ public interface GridLocalEventListener extends EventListener {
      */
     public void onEvent(Event evt);
 }
+


Mime
View raw message