Package com.sun.appserv.util.cache

Examples of com.sun.appserv.util.cache.Cache


        // use the context class loader to load class so that any
        // user-defined classes in WEB-INF can also be loaded.
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        Class cacheClass = cl.loadClass(className);

        Cache cacheImpl = (Cache)cacheClass.newInstance();
        cacheImpl.init(maxEntries, cacheProps);

        return cacheImpl;
    }
View Full Code Here


        // create a new cachemanager if one is not present and use it
        // to create a new cache
        if (cm == null)
            cm = new CacheManager();

        Cache cache = null;
        try {
            cache = cm.createCache();
        } catch (Exception ex) {}

        // set the cache as a context attribute
View Full Code Here

     */
    public void contextDestroyed(ServletContextEvent sce) {
        ServletContext context = sce.getServletContext();

        // Remove the cache from context and clear the cache
        Cache cache = (Cache)context.getAttribute(Constants.JSPTAG_CACHE_KEY);

        if (cache != null) {
            context.removeAttribute(Constants.JSPTAG_CACHE_KEY);
            cache.clear();
        }
    }
View Full Code Here

        // to create a new cache
        if (cm == null) {
            cm = new CacheManager();
        }

        Cache cache = null;
        try {
            cache = cm.createCache();
        } catch (Exception ex) {}

        // Set the cache as a request attribute
View Full Code Here

     */
    public void requestDestroyed(ServletRequestEvent sre) {

        // Clear the cache
        ServletRequest req = sre.getServletRequest();
        Cache cache = (Cache) req.getAttribute(Constants.JSPTAG_CACHE_KEY);
        if (cache != null) {
            cache.clear();
        }
    }
View Full Code Here

        // to create a new cache
        if (cm == null) {
            cm = new CacheManager();
        }

        Cache cache = null;
        try {
            cache = cm.createCache();
        } catch (Exception ex) {}

        // Set the cache as a session attribute
View Full Code Here

     */
    public void sessionDestroyed(HttpSessionEvent hse) {

        // Clear the cache
        HttpSession session = hse.getSession()
        Cache cache = (Cache)session.getAttribute(Constants.JSPTAG_CACHE_KEY);
        if (cache != null) {
            cache.clear();
        }
    }
View Full Code Here

     */
    public int doStartTag()
        throws JspException
    {
        // get the cache from the specified scope
        Cache cache = CacheUtil.getCache(pageContext, _scope);

        // generate the cache key using the user specified key.
  
        if (_key != null) {
            String key = CacheUtil.generateKey(_key, pageContext);

            // remove the entry for the key
            cache.remove(key);

            if (_debugLog)
                _logger.fine("FlushTag: clear ["+ key +"]");
        } else {
            // clear the entire cache
            cache.clear();

            if (_debugLog)
                _logger.fine("FlushTag: clear cache");
        }

View Full Code Here

     */
    public int doStartTag()
        throws JspException
    {
        // get the cache from the specified scope
        Cache cache = CacheUtil.getCache(pageContext, _scope);

        // generate the cache key using the user specified key.
  
        if (_key != null) {
            String key = CacheUtil.generateKey(_key, pageContext);

            // remove the entry for the key
            cache.remove(key);

            if (_logger.isLoggable(Level.FINE))
                _logger.log(Level.FINE, FLUSH_TAG_CLEAR_KEY, key);
        } else {
            // clear the entire cache
            cache.clear();

            if (_logger.isLoggable(Level.FINE))
                _logger.log(Level.FINE, FLUSH_TAG_CLEAR_CACHE);
        }

View Full Code Here

        // use the context class loader to load class so that any
        // user-defined classes in WEB-INF can also be loaded.
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        Class cacheClass = cl.loadClass(className);

        Cache cacheImpl = (Cache)cacheClass.newInstance();
        cacheImpl.init(maxEntries, cacheProps);

        return cacheImpl;
    }
View Full Code Here

TOP

Related Classes of com.sun.appserv.util.cache.Cache

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.