Author: manik.surtani(a)jboss.com
Date: 2008-05-07 07:23:35 -0400 (Wed, 07 May 2008)
New Revision: 5802
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java
Log:
EHCache to deal with serializable objects
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java 2008-05-07
11:19:43 UTC (rev 5801)
+++
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java 2008-05-07
11:23:35 UTC (rev 5802)
@@ -7,7 +7,7 @@
import net.sf.ehcache.config.ConfigurationFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.cachebench.SerializableCacheWrapper;
+import org.cachebench.CacheWrapper;
import java.io.Serializable;
import java.net.URL;
@@ -17,13 +17,13 @@
/**
* An implementation of SerializableCacheWrapper that uses EHCache as an underlying
implementation.
- *
+ * <p/>
* Pass in a -Dbind.address=IP_ADDRESS
*
* @author Manik Surtani (manik(a)surtani.org)
* @version $Id: EHCacheWrapper.java,v 1.6 2007/05/21 16:17:56 msurtani Exp $
*/
-public class EHCacheWrapper implements SerializableCacheWrapper
+public class EHCacheWrapper implements CacheWrapper
{
private CacheManager manager;
private Ehcache cache;
@@ -43,7 +43,7 @@
// frig the manager to use a bind address as per sys props
String bindAddress = System.getProperty("bind.address");
- if (bindAddress!= null)
+ if (bindAddress != null)
{
String props =
c.getCacheManagerPeerListenerFactoryConfiguration().getProperties();
props = injectBindAddress(props, bindAddress);
@@ -51,7 +51,7 @@
}
manager = new CacheManager(c);
-
+
logger.debug("Finish Initializing the cache");
}
@@ -136,7 +136,7 @@
*/
public void put(Object key, Object value) throws Exception
{
- throw new Exception("Put: Does not deal with non-Serializables, should not be
called.");
+ putSerializable((Serializable) key, (Serializable) value);
}
/* (non-Javadoc)
@@ -144,7 +144,7 @@
*/
public Object get(Object key) throws Exception
{
- throw new Exception("Get: Does not deal with non-Serializables, should not be
called.");
+ return getSerializable((Serializable) key);
}
public int getNumMembers()
Show replies by date