You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2015/11/20 02:07:38 UTC

[03/20] incubator-geode git commit: move LifeCycleListener out of SimpleMemoryAllocatorImpl

move LifeCycleListener out of SimpleMemoryAllocatorImpl


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

Branch: refs/heads/feature/GEODE-580
Commit: d4991d00395b020ba59d1f58a6a780ed61679e4e
Parents: f4dd17d
Author: Darrel Schneider <ds...@pivotal.io>
Authored: Thu Nov 19 15:21:16 2015 -0800
Committer: Darrel Schneider <ds...@pivotal.io>
Committed: Thu Nov 19 15:21:16 2015 -0800

----------------------------------------------------------------------
 .../internal/offheap/LifecycleListener.java     | 55 ++++++++++++++++++++
 .../offheap/SimpleMemoryAllocatorImpl.java      | 38 --------------
 ...moryAllocatorLifecycleListenerJUnitTest.java |  1 -
 3 files changed, 55 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d4991d00/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/LifecycleListener.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/LifecycleListener.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/LifecycleListener.java
new file mode 100644
index 0000000..b171408
--- /dev/null
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/LifecycleListener.java
@@ -0,0 +1,55 @@
+/*
+ * 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 com.gemstone.gemfire.internal.offheap;
+
+/**
+ * Used by tests to get notifications about the lifecycle of a 
+ * SimpleMemoryAllocatorImpl.
+ * 
+ * @author Kirk Lund
+ */
+public interface LifecycleListener {
+  /**
+   * Callback is invoked after creating a new SimpleMemoryAllocatorImpl. 
+   * 
+   * Create occurs during the first initialization of an 
+   * InternalDistributedSystem within the JVM.
+   * 
+   * @param allocator the instance that has just been created
+   */
+  public void afterCreate(SimpleMemoryAllocatorImpl allocator);
+  /**
+   * Callback is invoked after reopening an existing SimpleMemoryAllocatorImpl 
+   * for reuse. 
+   * 
+   * Reuse occurs during any intialization of an 
+   * InternalDistributedSystem after the first one was connected and then
+   * disconnected within the JVM.
+   * 
+   * @param allocator the instance that has just been reopened for reuse
+   */
+  public void afterReuse(SimpleMemoryAllocatorImpl allocator);
+  /**
+   * Callback is invoked before closing the SimpleMemoryAllocatorImpl
+   * 
+   * Close occurs after the InternalDistributedSystem and DistributionManager 
+   * have completely disconnected. 
+   * 
+   * @param allocator the instance that is about to be closed
+   */
+  public void beforeClose(SimpleMemoryAllocatorImpl allocator);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d4991d00/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
index 7288e55..5113cc3 100644
--- a/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
+++ b/gemfire-core/src/main/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorImpl.java
@@ -3259,42 +3259,4 @@ public final class SimpleMemoryAllocatorImpl implements MemoryAllocator, MemoryI
       listener.beforeClose(allocator);
     }
   }
-  
-  /**
-   * Used by tests to get notifications about the lifecycle of a 
-   * SimpleMemoryAllocatorImpl.
-   * 
-   * @author Kirk Lund
-   */
-  public interface LifecycleListener {
-    /**
-     * Callback is invoked after creating a new SimpleMemoryAllocatorImpl. 
-     * 
-     * Create occurs during the first initialization of an 
-     * InternalDistributedSystem within the JVM.
-     * 
-     * @param allocator the instance that has just been created
-     */
-    public void afterCreate(SimpleMemoryAllocatorImpl allocator);
-    /**
-     * Callback is invoked after reopening an existing SimpleMemoryAllocatorImpl 
-     * for reuse. 
-     * 
-     * Reuse occurs during any intialization of an 
-     * InternalDistributedSystem after the first one was connected and then
-     * disconnected within the JVM.
-     * 
-     * @param allocator the instance that has just been reopened for reuse
-     */
-    public void afterReuse(SimpleMemoryAllocatorImpl allocator);
-    /**
-     * Callback is invoked before closing the SimpleMemoryAllocatorImpl
-     * 
-     * Close occurs after the InternalDistributedSystem and DistributionManager 
-     * have completely disconnected. 
-     * 
-     * @param allocator the instance that is about to be closed
-     */
-    public void beforeClose(SimpleMemoryAllocatorImpl allocator);
-  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/d4991d00/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorLifecycleListenerJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorLifecycleListenerJUnitTest.java b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorLifecycleListenerJUnitTest.java
index 38f969e..4ace307 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorLifecycleListenerJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/internal/offheap/SimpleMemoryAllocatorLifecycleListenerJUnitTest.java
@@ -26,7 +26,6 @@ import org.junit.Assert;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import com.gemstone.gemfire.internal.offheap.SimpleMemoryAllocatorImpl.LifecycleListener;
 import com.gemstone.gemfire.test.junit.categories.UnitTest;
 
 /**