You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mc...@apache.org on 2011/10/13 12:57:10 UTC

svn commit: r1182777 - in /commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal: Cache.java CacheEntryFactory.java ClassCache.java ClassCacheEntryFactory.java

Author: mcucchiara
Date: Thu Oct 13 10:57:10 2011
New Revision: 1182777

URL: http://svn.apache.org/viewvc?rev=1182777&view=rev
Log:
New Class Cache base implementation

Added:
    commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java
Modified:
    commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/CacheEntryFactory.java
    commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCache.java
    commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheEntryFactory.java

Added: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java?rev=1182777&view=auto
==============================================================================
--- commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java (added)
+++ commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/Cache.java Thu Oct 13 10:57:10 2011
@@ -0,0 +1,38 @@
+/*
+ * $Id: $
+ *
+ * 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.commons.ognl.internal;
+
+public interface Cache<K, V>
+{
+    void clear( );
+
+    int getSize( );
+
+    V get( K key )
+        throws CacheException;
+
+    V get( K key, CacheEntryFactory<K, V> cacheEntryFactory )
+        throws CacheException;
+
+    V put( K key, V value );
+
+}

Modified: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/CacheEntryFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/CacheEntryFactory.java?rev=1182777&r1=1182776&r2=1182777&view=diff
==============================================================================
--- commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/CacheEntryFactory.java (original)
+++ commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/CacheEntryFactory.java Thu Oct 13 10:57:10 2011
@@ -21,8 +21,8 @@
 
 package org.apache.commons.ognl.internal;
 
-public interface CacheEntryFactory<T, V>
+public interface CacheEntryFactory<K, V>
 {
-    public V create( T key )
+    public V create( K key )
         throws CacheException;
 }

Modified: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCache.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCache.java?rev=1182777&r1=1182776&r2=1182777&view=diff
==============================================================================
--- commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCache.java (original)
+++ commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCache.java Thu Oct 13 10:57:10 2011
@@ -27,19 +27,7 @@ import org.apache.commons.ognl.ClassCach
  * This is a highly specialized map for storing values keyed by Class objects.
  */
 public interface ClassCache<V>
+    extends Cache<Class<?>, V>
 {
-
     void setClassInspector( ClassCacheInspector inspector );
-
-    void clear();
-
-    int getSize();
-
-    V get( Class<?> key, CacheEntryFactory<Class<?>, V> cacheEntryFactory )
-        throws CacheException;
-
-    V get( Class<?> key )
-        throws CacheException;
-
-    V put( Class<?> key, V value );
 }

Modified: commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheEntryFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheEntryFactory.java?rev=1182777&r1=1182776&r2=1182777&view=diff
==============================================================================
--- commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheEntryFactory.java (original)
+++ commons/proper/ognl/branches/new-cache-approach/src/main/java/org/apache/commons/ognl/internal/ClassCacheEntryFactory.java Thu Oct 13 10:57:10 2011
@@ -21,10 +21,7 @@
 
 package org.apache.commons.ognl.internal;
 
-public interface ClassCacheEntryFactory<V>
-    extends CacheEntryFactory<Class<?>, V>
+public interface ClassCacheEntryFactory<T>
+    extends CacheEntryFactory<Class<?>, T>
 {
-    V create( Class<?> key )
-        throws CacheException;
-
 }