[jboss-cvs] CacheBenchFwk/cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers ...

Manik Surtani manik at jboss.org
Fri May 18 11:35:25 EDT 2007


  User: msurtani
  Date: 07/05/18 11:35:25

  Added:       cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers 
                        CoherenceWrapper.java
  Log:
  Added Stuff
  
  Revision  Changes    Path
  1.1      date: 2007/05/18 15:35:25;  author: msurtani;  state: Exp;CacheBenchFwk/cache-products/coherence-3.2.2/src/org/cachebench/cachewrappers/CoherenceWrapper.java
  
  Index: CoherenceWrapper.java
  ===================================================================
  package org.cachebench.cachewrappers;
  
  import org.cachebench.CacheWrapper;
  
  import java.util.Properties;
  
  import com.tangosol.net.NamedCache;
  import com.tangosol.net.CacheFactory;
  
  /**
   *
   * @author <a href="mailto:manik at jboss.org">Manik Surtani</a>
   * @since 2.0.0
   */
  public class CoherenceWrapper implements CacheWrapper
  {
     NamedCache cache;
  
     public void init(Properties parameters) throws Exception
     {
        cache = CacheFactory.getReplicatedCache();
  //      cache = CacheFactory.getCache("VirtualCache");
     }
  
     public void setUp() throws Exception
     {
     }
  
     public void tearDown() throws Exception
     {
        cache.release();
     }
  
     public void put(Object key, Object value) throws Exception
     {
        cache.put(key, value);
     }
  
     public Object get(Object key) throws Exception
     {
        return cache.get(key);
     }
  
     public void empty() throws Exception
     {
        cache.clear();
     }
  
     public int getNumMembers()
     {
        return cache.getCacheService().getCluster().getMemberSet().size();
     }
  
     public String getInfo()
     {
        return cache.keySet().toString();
     }
  }
  
  
  



More information about the jboss-cvs-commits mailing list