Package org.apache.cocoon.caching

Examples of org.apache.cocoon.caching.Cache


                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
        Cache cache = null;

        try {
            cache = (Cache)this.manager.lookup(cacheRole);
            cache.clear();
            return EMPTY_MAP;
        } catch (Exception ex) {
          if (this.getLogger().isDebugEnabled()) {
                getLogger().debug("Exception while trying to clear Cache with role " + cacheRole, ex);
            }
View Full Code Here


                    SourceResolver resolver,
                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        Cache cache = (Cache)this.manager.lookup(Cache.ROLE);
        if (cache instanceof EventAwareCacheImpl) {
            Request request = ObjectModelHelper.getRequest(objectModel);
            String eventName = par.getParameter("event");
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Configured for cache event named: " + eventName);
View Full Code Here

                    SourceResolver resolver,
                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        Cache cache = (Cache)this.manager.lookup(Cache.ROLE);
        if (cache instanceof EventAwareCacheImpl) {
            String eventName = par.getParameter("event");
            if (getLogger().isDebugEnabled()) {
                getLogger().debug("Configured for cache event named: " + eventName);
            }
View Full Code Here

        if ( "remove".equals(action)) {
            final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
            final String cacheKey = par.getParameter("cache-key");
       
            if ( cacheKey != null ) {
                Cache cache = null;

                SimpleCacheKey key = new SimpleCacheKey(cacheKey, true);
                try {
                    cache = (Cache)this.manager.lookup(cacheRole);
                    cache.remove(key);
               
                    key = new SimpleCacheKey(cacheKey, false);
                    cache.remove(key);
                } catch (Exception ex) {
                    if (this.getLogger().isDebugEnabled()) {
                        getLogger().debug("Exception while trying to remove entry "+cacheKey+" from Cache with role " + cacheRole, ex);
                    }
                } finally {
View Full Code Here

                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
        Cache cache = null;

        try {
            cache = (Cache)this.manager.lookup(cacheRole);
            cache.clear();
            return EMPTY_MAP;
        } catch (Exception ex) {
          if (this.getLogger().isDebugEnabled()) {
                getLogger().debug("Exception while trying to clear Cache with role " + cacheRole, ex);
            }
View Full Code Here

                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        final String cacheRole = par.getParameter("cache-role", Cache.ROLE + "/EventAware");
        Cache cache = (Cache)this.manager.lookup(cacheRole);
        try {
            // FIXME - This cast might not work with every container!
            if (cache instanceof EventAwareCacheImpl) {
                String eventName = par.getParameter("event");
                if (getLogger().isDebugEnabled()) {
View Full Code Here

                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
        Cache cache = null;

        try {
            cache = (Cache)this.manager.lookup(cacheRole);
            cache.clear();
            return EMPTY_MAP;
        } catch (Exception ex) {
          if (this.getLogger().isDebugEnabled()) {
                getLogger().debug("Exception while trying to clear Cache with role " + cacheRole, ex);
            }
View Full Code Here

    public void execute(String name) {
        if (this.uri != null) {
            if (this.getLogger().isDebugEnabled()) {
                this.getLogger().debug("Refreshing " + this.uri);
            }
            Cache cache = null;
            CachingSource source = null;
            try {
                cache = (Cache) manager.lookup(cacheRole);
                source = CachingSourceFactory.newCachingSource(
                                               this.resolver.resolveURI(this.uri),
View Full Code Here

        if ( "remove".equals(action)) {
            final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
            final String cacheKey = par.getParameter("cache-key");
       
            if ( cacheKey != null ) {
                Cache cache = null;

                IdentifierCacheKey key = new IdentifierCacheKey(cacheKey, true);
                try {
                    cache = (Cache)this.manager.lookup(cacheRole);
                    cache.remove(key);
               
                    key = new IdentifierCacheKey(cacheKey, false);
                    cache.remove(key);
                } catch (Exception ex) {
                    if (this.getLogger().isDebugEnabled()) {
                        getLogger().debug("Exception while trying to remove entry "+cacheKey+" from Cache with role " + cacheRole, ex);
                    }
                } finally {
View Full Code Here

                    Map objectModel,
                    String src,
                    Parameters par
    ) throws Exception {
        final String cacheRole = par.getParameter("cache-role", Cache.ROLE);
        Cache cache = null;

        try {
            cache = (Cache)this.manager.lookup(cacheRole);
            cache.clear();
            return EMPTY_MAP;
        } catch (Exception ex) {
          if (this.getLogger().isDebugEnabled()) {
                getLogger().debug("Exception while trying to clear Cache with role " + cacheRole, ex);
            }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.caching.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.