Package org.jboss.cache

Examples of org.jboss.cache.CacheManager


         ContextClassLoaderSwitcher.SwitchContext switchContext = switcher.getSwitchContext(getClass().getClassLoader());
         try
         {
            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


    * @deprecated use {@link #findPlainCache(String, CacheManager)
    */
   @Deprecated
   public static Cache<Object, Object> 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

    *
    * @throws IllegalStateException if no cache manager can be found
    */
   public CacheManager getCacheManager(Hashtable jndiProperties)
   {
      CacheManager manager = registeredManager;
      if (manager == null)
      {
         try
         {
            manager = findInJndi(jndiProperties);
View Full Code Here

    * @deprecated use {@link #findPlainCache(String, CacheManager)
    */
   @Deprecated
   public static Cache<Object, Object> 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

   {
      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 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 remoteCache = remoteManager.getCache(getEntityCacheConfigName(), true);
      MyListener remoteListener = new MyListener();
      remoteCache.addCacheListener(remoteListener);     
     
      TransactionManager remoteTM = remoteCache.getConfiguration().getRuntimeConfig().getTransactionManager();
     
View Full Code Here

      }
   }
  
   public static Cache<Object, Object> 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

  
   protected void releaseCacheToManager(String cacheConfigName)
   {     
      try
      {
         CacheManager cm = CacheManagerLocator.getCacheManagerLocator().getCacheManager(null);
         cm.releaseCache(cacheConfigName);
      }
      catch (Exception e)
      {
         log_.error("Problem releasing cache to CacheManager -- config is " + cacheConfigName, e);
      }
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.