Examples of CacheManager


Examples of net.sf.ehcache.CacheManager

    @Create
    public void startup() throws Exception {

        log.info("starting wiki page fragment cache regions");
        try {
            CacheManager manager = EHCacheManager.instance();

            Set<String> requiredCacheRegions = new HashSet<String>();

            if (cacheRegions != null) {
                requiredCacheRegions.addAll(cacheRegions);
            }

            PluginRegistry pluginRegistry = PluginRegistry.instance();
            for (Plugin plugin : pluginRegistry.getPlugins()) {
                for (PluginModule pluginModule : plugin.getModules()) {
                    if (pluginModule.getFragmentCacheRegions() != null)
                        requiredCacheRegions.addAll(pluginModule.getFragmentCacheRegions());
                }
            }

            for (String cacheRegion : requiredCacheRegions) {
                Cache cache = EHCacheManager.instance().getCache(cacheRegion);
                if (cache == null) {
                    log.info("using default configuration for region '" + cacheRegion + "'");
                    manager.addCache(cacheRegion);
                    cache = manager.getCache(cacheRegion);
                    log.debug("started EHCache region: " + cacheRegion);
                }
                caches.put(cacheRegion, cache);
            }
View Full Code Here

Examples of net.sf.ehcache.CacheManager

    public void initCacheManager() {
        log.info("instantiating EHCacheManager from /ehcache.xml");
        // Do NOT use the CacheManage.create() factory methods, as they create a singleton! Our applicatoin
        // has to have its own CacheManager instance, so that we can run several applications in the same
        // JVM or application server.
        manager = new CacheManager();

        if (isRegisterMonitoring()) {
            // Register statistics MBean of EHCache on the current MBean server
            log.info("registering EHCache monitoring MBean");
            MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
View Full Code Here

Examples of net.sf.ehcache.CacheManager

      LOGGER.info("Configuring Cache from {} ",
          configFile.getAbsolutePath());
      InputStream in = null;
      try {
        in = processConfig(new FileInputStream(configFile), properties);
        cacheManager = new CacheManager(in);
      } finally {
        if (in != null) {
          in.close();
        }
      }
    } else {
      LOGGER.info("Configuring Cache from Classpath Default {} ",
          CONFIG_PATH);
      InputStream in = processConfig(this.getClass().getClassLoader()
          .getResourceAsStream(CONFIG_PATH), properties);
      if (in == null) {
        throw new IOException(
            "Unable to open config at classpath location "
                + CONFIG_PATH);
      }
      cacheManager = new CacheManager(in);
      in.close();
    }

    final WeakReference<CacheManagerServiceImpl> ref = new WeakReference<CacheManagerServiceImpl>(
        this);
View Full Code Here

Examples of net.sf.ehcache.CacheManager

public class RetryLimitHashedCredentialsMatcher extends HashedCredentialsMatcher {

    private Ehcache passwordRetryCache;

    public RetryLimitHashedCredentialsMatcher() {
        CacheManager cacheManager = CacheManager.newInstance(CacheManager.class.getClassLoader().getResource("ehcache.xml"));
        passwordRetryCache = cacheManager.getCache("passwordRetryCache");
    }
View Full Code Here

Examples of net.sf.ehcache.CacheManager

public class RetryLimitHashedCredentialsMatcher extends HashedCredentialsMatcher {

    private Ehcache passwordRetryCache;

    public RetryLimitHashedCredentialsMatcher() {
        CacheManager cacheManager = CacheManager.newInstance(CacheManager.class.getClassLoader().getResource("ehcache.xml"));
        passwordRetryCache = cacheManager.getCache("passwordRetryCache");
    }
View Full Code Here

Examples of net.sf.ehcache.CacheManager

public class RetryLimitHashedCredentialsMatcher extends HashedCredentialsMatcher {

    private Ehcache passwordRetryCache;

    public RetryLimitHashedCredentialsMatcher() {
        CacheManager cacheManager = CacheManager.create(CacheManager.class.getClassLoader().getResource("password-ehcache.xml"));
        passwordRetryCache = cacheManager.getCache("passwordRetryCache");
    }
View Full Code Here

Examples of net.sf.ehcache.CacheManager

      log.debug("Starting EhCacheProvider cache");
      try
      {
         if (getConfiguration() != null)
         {
            cacheManager = new CacheManager(getConfigurationAsStream());
         }
         else
         {
            cacheManager = new CacheManager();
         }
      }
      catch (net.sf.ehcache.CacheException e)
      {
         throw new IllegalStateException("Error starting EHCache Cache", e);
View Full Code Here

Examples of net.sf.jsr107cache.CacheManager

   */
  private StatisticsManager(){
    Map<String, String> props = new HashMap<String, String>();
    props.put(GCacheFactory.NAMESPACE, C_NAMESPACE);
//    props.put(GCacheFactory.EXPIRATION_DELTA, C_TIMEOUT);
    CacheManager cMan = CacheManager.getInstance();
    props.put("name", C_NAME);
    try{
      CacheFactory cFac = cMan.getCacheFactory();
      Cache cache = cFac.createCache(props);
      cMan.registerCache(C_NAME, cache);
      cache.put(C_KEY_RESULTS, new Results());
      cache.put(C_KEY_SUMMARY, retrieveSummary());
    }catch(CacheException e){
     
    }
View Full Code Here

Examples of org.ajax4jsf.cache.CacheManager

    private Cache cache;
   
    public void init(ServletContext servletContext) {
      try {
    CacheManager cacheManager = CacheManager.getInstance();
    Map env = new ServletContextInitMap(servletContext);
    CacheFactory cacheFactory = cacheManager.getCacheFactory(env);
    this.cache = cacheFactory.createCache(env, this, this);
    servletContext.setAttribute(EVENTS_MANAGER_KEY, this);
  } catch (CacheException e) {
    throw new FacesException(e.getMessage(), e);
  }
View Full Code Here

Examples of org.apache.avalon.repository.provider.CacheManager

        }

        Factory factory = context.getInitialFactory();
        assertNotNull( factory );

        CacheManager manager = (CacheManager) factory.create() ;
        assertNotNull( manager ) ;
  
        Repository repository = manager.createRepository() ;
        assertNotNull( repository ) ;
       
        Artifact artifact = Artifact.createArtifact(
          "avalon-framework", "avalon-framework-api", "4.1.5" );
        URL url = repository.getResource( artifact );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.