Author: bperroud
Date: Sun Feb 26 07:36:36 2012
New Revision: 1293761

URL: http://svn.apache.org/viewvc?rev=1293761&view=rev
Log:
DIRECTMEMORY-60 : simplify a bit the code

Removed:
    
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/memory/
Modified:
    
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java
    
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java

Modified: 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java?rev=1293761&r1=1293760&r2=1293761&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java
 (original)
+++ 
incubator/directmemory/trunk/directmemory-cache/src/main/java/org/apache/directmemory/memory/MemoryManagerServiceWithAllocationPolicyImpl.java
 Sun Feb 26 07:36:36 2012
@@ -34,6 +34,18 @@ public class MemoryManagerServiceWithAll
     
     protected AllocationPolicy<V> allocationPolicy;
 
+    public MemoryManagerServiceWithAllocationPolicyImpl()
+    {
+        super();
+    }
+    
+    public MemoryManagerServiceWithAllocationPolicyImpl( final 
AllocationPolicy<V> allocationPolicy, final boolean returnNullWhenFull )
+    {
+        this();
+        this.setAllocationPolicy( allocationPolicy );
+        this.returnNullWhenFull = returnNullWhenFull;
+    }
+    
     @Override
     public void init( int numberOfBuffers, int size )
     {

Modified: 
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
URL: 
http://svn.apache.org/viewvc/incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java?rev=1293761&r1=1293760&r2=1293761&view=diff
==============================================================================
--- 
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
 (original)
+++ 
incubator/directmemory/trunk/integrations/ehcache/src/main/java/org/apache/directmemory/ehcache/DirectMemoryCache.java
 Sun Feb 26 07:36:36 2012
@@ -24,7 +24,7 @@ import java.util.Set;
 import org.apache.directmemory.cache.CacheService;
 import org.apache.directmemory.cache.CacheServiceImpl;
 import org.apache.directmemory.memory.MemoryManagerService;
-import 
org.apache.directmemory.memory.MemoryManagerServiceWithAllocationPolicyEhcacheImpl;
+import 
org.apache.directmemory.memory.MemoryManagerServiceWithAllocationPolicyImpl;
 import org.apache.directmemory.memory.OffHeapMemoryBuffer;
 import org.apache.directmemory.memory.Pointer;
 import org.apache.directmemory.memory.RoundRobinAllocationPolicy;
@@ -40,8 +40,8 @@ import org.apache.directmemory.serializa
 public class DirectMemoryCache<K, V>
 {
 
-    private MemoryManagerService<V> memoryManager = new 
MemoryManagerServiceWithAllocationPolicyEhcacheImpl<V>(
-                                                                               
                                 new RoundRobinAllocationPolicy<V>() );
+    private MemoryManagerService<V> memoryManager = new 
MemoryManagerServiceWithAllocationPolicyImpl<V>(
+                                                                               
                                 new RoundRobinAllocationPolicy<V>(), false );
 
     private CacheServiceImpl<K, V> cacheService = new CacheServiceImpl<K, V>( 
memoryManager );
 


Reply via email to