Package org.jboss.cache

Examples of org.jboss.cache.CacheManager


         boolean available = (cacheName != null);
         if (available)
         {      
            try
            {
               CacheManager cm = CacheManagerLocator.getCacheManagerLocator().getCacheManager(null);
               available = cm.getConfigurationNames().contains(cacheName);
            }
            catch (IllegalStateException ise)
            {
               log.debug("No CacheManager available");
               available = false;
View Full Code Here


         try
         {
            // Determine if our cache is a PojoCache or a plain Cache
            if (cacheObjectName == null)
            {
               CacheManager cm = CacheManagerLocator.getCacheManagerLocator().getCacheManager(null);
               cache = cm.getCache(cacheName, true);              
            }
            else if (server != null)
            {           
               // Look in JMX
               MBeanInfo info = server.getMBeanInfo(cacheObjectName);
View Full Code Here

      }
   }
  
   public static Cache findPlainCache(String cacheConfigName) throws ClusteringNotSupportedException
   {
      CacheManager pcm = getManagerForCache(cacheConfigName);
     
      try
      {
         return pcm.getCache(cacheConfigName, true);
      }
      catch (RuntimeException re)
      {
         throw re;
      }
View Full Code Here

   }
  
   private static CacheManager getManagerForCache(String cacheConfigName)
      throws ClusteringNotSupportedException
   {
      CacheManager cm = null;
      try
      {
         cm = CacheManagerLocator.getCacheManagerLocator().getCacheManager(null);
      }
      catch (Throwable t)
      {
         throw new ClusteringNotSupportedException("Could not access CacheManager for JBossWeb clustering", t);
      }
     
      if (!cm.getConfigurationNames().contains(cacheConfigName))
         throw new IllegalStateException("CacheManager does not recognize config " + cacheConfigName);
     
      return cm;
   }
View Full Code Here

      addToNode(tempNode, tempName, level - 1);
    }
  }

  private void getCacheNames() {
    CacheManager cm = CacheManagerLocator.getCacheManagerLocator()
        .getCacheManager(null);
    Set<String> names = cm.getCacheNames();

    cacheNames = names;
  }
View Full Code Here

  public void getCaches(String cacheName) {
    Cache cache = null;
    try {
      if (cacheName != null) {
        CacheManager cm = CacheManagerLocator.getCacheManagerLocator()
            .getCacheManager(null);

        cache = cm.getCache(cacheName, true);

        listener = new MyListener();
        cache.addCacheListener(listener);

        cache.start();
View Full Code Here

  public void getCache(String cacheConfigName) {
    this.cacheConfigName = cacheConfigName;

    try {
      if (cache == null && cacheConfigName != null) {
        CacheManager cm = CacheManagerLocator.getCacheManagerLocator()
            .getCacheManager(null);
        cache = cm.getCache(cacheConfigName, true);
        cache.start();
      }

    } catch (Exception e) {
      throw new RuntimeException(e);
View Full Code Here

  
   protected void queryTest(boolean useNamedRegion) throws Exception
   {
      // Bind a listener to the "local" cache
      // Our region factory makes its CacheManager available to us
      CacheManager localManager = TestCacheInstanceManager.getTestCacheManager(DualNodeTestUtil.LOCAL);
      this.localCache = localManager.getCache(getEntityCacheConfigName(), true);
      this.localListener = new CacheAccessListener();
      localCache.addCacheListener(localListener);
     
      TransactionManager localTM = localCache.getConfiguration().getRuntimeConfig().getTransactionManager();
     
      // Bind a listener to the "remote" cache
      CacheManager remoteManager = TestCacheInstanceManager.getTestCacheManager(DualNodeTestUtil.REMOTE);
      this.remoteCache = remoteManager.getCache(getEntityCacheConfigName(), true);
      this.remoteListener = new CacheAccessListener();
      remoteCache.addCacheListener(remoteListener);     
     
      TransactionManager remoteTM = remoteCache.getConfiguration().getRuntimeConfig().getTransactionManager();
     
View Full Code Here

   {
      super.tearDown();
     
      this.channelFactory = null;
     
      CacheManager jbcFactory = this.cacheManagerRef.get();
      this.cacheManagerRef.set(null);
      ((CacheManagerImpl) jbcFactory).stop();
   }
View Full Code Here

   {
      System.out.println("*** testAll()");
     
      // Bind a listener to the "local" cache
      // Our region factory makes its CacheManager available to us
      CacheManager localManager = TestCacheInstanceManager.getTestCacheManager(DualNodeTestUtil.LOCAL);
      Cache<Object, Object> localCache = localManager.getCache(getEntityCacheConfigName(), true);
      MyListener localListener = new MyListener();
      localCache.addCacheListener(localListener);
     
      TransactionManager localTM = localCache.getConfiguration().getRuntimeConfig().getTransactionManager();
     
      // Bind a listener to the "remote" cache
      CacheManager remoteManager = TestCacheInstanceManager.getTestCacheManager(DualNodeTestUtil.REMOTE);
      Cache<Object, Object> remoteCache = remoteManager.getCache(getEntityCacheConfigName(), true);
      MyListener remoteListener = new MyListener();
      remoteCache.addCacheListener(remoteListener);     
     
      TransactionManager remoteTM = remoteCache.getConfiguration().getRuntimeConfig().getTransactionManager();
     
View Full Code Here

TOP

Related Classes of org.jboss.cache.CacheManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.