Package org.apache.jetspeed.cache

Examples of org.apache.jetspeed.cache.JetspeedCacheEventListener


        permissionsEnabled = pageManager.getPermissionsEnabled();
        DatabasePageManagerCache.pageManager = pageManager;
       
        // setup local oid cache listener
        final DatabasePageManager databasePageManager = pageManager;
        oidCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
            {
                NodeImpl node = (NodeImpl)element;
                // infuse node with page manager configuration
                // or the page manager itself and add to the
                // paths cache
                node.setConstraintsEnabled(constraintsEnabled);
                node.setPermissionsEnabled(permissionsEnabled);
                node.setPageManager(databasePageManager);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementChanged(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementChanged(JetspeedCache cache, boolean local, Object key, Object element)
            {
                notifyElementAdded(cache, local, key, element);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementEvicted(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementEvicted(JetspeedCache cache, boolean local, Object key, Object element)
            {
                notifyElementRemoved(cache, local, key, element);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementExpired(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementExpired(JetspeedCache cache, boolean local, Object key, Object element)
            {
                notifyElementRemoved(cache, local, key, element);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementRemoved(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element)
            {
                NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }
        }, true);
       
        // setup remote path cache listener
        pathCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementChanged(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementChanged(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementEvicted(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementEvicted(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementExpired(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementExpired(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementRemoved(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element)
            {
                DatabasePageManagerCacheObject cacheObject = (DatabasePageManagerCacheObject)element;
                // remove cache object from local caches
                Identity oid = ((cacheObject != null) ? cacheObject.getId() : null);
                String path = ((cacheObject != null) ? cacheObject.getPath() : (String)key);
                if ((oid != null) || (path != null))
                {
                    synchronized (DatabasePageManagerCache.class)
                    {
                        if (oid != null)
                        {
                            // get object cached by oid
                            NodeImpl node = (NodeImpl)cacheLookup(oid);
                            // reset internal FolderImpl caches
                            if (node instanceof FolderImpl)
                            {
                                ((FolderImpl)node).resetAll(false);
                            }
                            // notify page manager of update
                            DatabasePageManagerCache.pageManager.notifyUpdatedNode(node);
                            // remove from cache
                            DatabasePageManagerCache.oidCache.removeQuiet(oid);
                        }
                        if (path != null)
                        {
                            // lookup parent object cached by path and oid
                            int pathLastSeparatorIndex = path.lastIndexOf(Folder.PATH_SEPARATOR);
                            String parentPath = ((pathLastSeparatorIndex > 0) ? path.substring(0, pathLastSeparatorIndex) : Folder.PATH_SEPARATOR);
                            NodeImpl parentNode = cacheLookup(parentPath);
                            // reset internal FolderImpl caches in case element removed
                            if (parentNode instanceof FolderImpl)
                            {
                                ((FolderImpl)parentNode).resetAll(false);
                            }
                            // remove all indexed fragment keys for page path from
                            // properties cache index
                            Set index = (Set)propertiesCacheIndexMap.get(path);
                            if (index != null)
                            {
                                // remove all indexed fragment keys
                                Iterator fragmentKeyIter = index.iterator();
                                while (fragmentKeyIter.hasNext())
                                {
                                    String fragmentKey = (String)fragmentKeyIter.next();
                                    // parse key to extract fragment id
                                    int fragmentId = getFragmentIdFromFragmentKey(fragmentKey);
                                    // remove principal fragment property list caches that have fragment properties
                                    if (fragmentId > 0)
                                    {
                                        clearPrincipalPropertiesCache(fragmentId);
                                    }
                                    // remove fragment property cache
                                    DatabasePageManagerCache.propertiesCache.removeQuiet(fragmentKey);
                                    DatabasePageManagerCache.propertiesPathCache.removeQuiet(fragmentKey);
                                }
                                propertiesCacheIndexMap.remove(path);
                            }
                        }                       
                    }
                }
            }
        }, false);
       
        // setup local properties cache listener
        propertiesCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
            {
                String fragmentKey = (String)key;
                DatabasePageManagerCachedFragmentPropertyList fragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)element;
                if (fragmentPropertyList != null)
                {
                    // add cache key to properties cache index
                    String path = fragmentPropertyList.getBaseFragmentsElementPath();
                    synchronized (DatabasePageManagerCache.class)
                    {
                        Set index = (Set)propertiesCacheIndexMap.get(path);
                        if (index == null)
                        {
                            index = new HashSet();
                            propertiesCacheIndexMap.put(path, index);
                        }
                        index.add(fragmentKey);
                    }
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementChanged(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementChanged(JetspeedCache cache, boolean local, Object key, Object element)
            {
                notifyElementAdded(cache, local, key, element);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementEvicted(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementEvicted(JetspeedCache cache, boolean local, Object key, Object element)
            {
                notifyElementRemoved(cache, local, key, element);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementExpired(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementExpired(JetspeedCache cache, boolean local, Object key, Object element)
            {
                notifyElementRemoved(cache, local, key, element);
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementRemoved(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element)
            {
                String fragmentKeyOrPath = (String)key;
                DatabasePageManagerCachedFragmentPropertyList fragmentPropertyList = (DatabasePageManagerCachedFragmentPropertyList)element;
                if (fragmentPropertyList != null)
                {
                    // remove single cache key from properties cache index
                    String path = fragmentPropertyList.getBaseFragmentsElementPath();
                    synchronized (DatabasePageManagerCache.class)
                    {
                        Set index = (Set)propertiesCacheIndexMap.get(path);
                        if (index != null)
                        {
                            index.remove(fragmentKeyOrPath);
                            if (index.isEmpty())
                            {
                                propertiesCacheIndexMap.remove(path);
                            }
                        }
                    }
                }
                else if (fragmentKeyOrPath != null)
                {
                    // remove all indexed cache keys from properties cache index
                    synchronized (DatabasePageManagerCache.class)
                    {
                        Set index = (Set)propertiesCacheIndexMap.get(fragmentKeyOrPath);
                        if (index != null)
                        {
                            // remove all indexed cache keys
                            Iterator fragmentKeyIter = index.iterator();
                            while (fragmentKeyIter.hasNext())
                            {
                                String fragmentKey = (String)fragmentKeyIter.next();
                                DatabasePageManagerCache.propertiesCache.removeQuiet(fragmentKey);
                            }
                            propertiesCacheIndexMap.remove(fragmentKeyOrPath);
                        }
                    }                   
                }
                else if (fragmentKeyOrPath != null)
                {
                    // remove all cache keys from properties cache index
                    synchronized (DatabasePageManagerCache.class)
                    {
                        propertiesCacheIndexMap.clear();
                    }
                }
            }
        }, true);
       
        // setup remote properties path cache listener
        propertiesPathCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementChanged(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementChanged(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementEvicted(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementEvicted(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementExpired(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementExpired(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementRemoved(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element)
            {
                DatabasePageManagerFragmentKeyCacheObject cacheObject = (DatabasePageManagerFragmentKeyCacheObject)element;
                // remove cache object from local properties cache
                String fragmentKey = ((cacheObject != null) ? cacheObject.getFragmentKey() : (String)key);
                if (fragmentKey != null)
                {
                    // parse key to extract fragment id
                    int fragmentId = getFragmentIdFromFragmentKey(fragmentKey);
                    // remove cached objects
                    synchronized (DatabasePageManagerCache.class)
                    {
                        // remove principal fragment property list caches that have fragment properties
                        if (fragmentId > 0)
                        {
                            clearPrincipalPropertiesCache(fragmentId);
                        }
                        // remove from fragment property list cache
                        DatabasePageManagerCache.propertiesCache.remove(fragmentKey);
                    }
                }
            }
        }, false);
       
        // setup remote principal properties path cache listener
        principalPropertiesPathCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(JetspeedCache cache, boolean local, Object key, Object element)
View Full Code Here


      List listeners = (local?localListeners:remoteListeners);
        for (int ix = 0; ix < listeners.size(); ix++)
        {
          try
          {
            JetspeedCacheEventListener listener = (JetspeedCacheEventListener)listeners.get(ix);
            switch (action)
            {
              case CacheElement.ActionAdded:
                listener.notifyElementAdded(this,local, key,value);
                break;
              case CacheElement.ActionChanged:
                listener.notifyElementChanged(this,local, key,value);
                break;
              case CacheElement.ActionRemoved:
                listener.notifyElementRemoved(this,local, key,value);
                break;
              case CacheElement.ActionEvicted:
                listener.notifyElementEvicted(this,local, key,value);
                break;
              case CacheElement.ActionExpired:
                listener.notifyElementExpired(this,local, key,value);
                break;
            }
          }
          catch (Exception e)
          {
View Full Code Here

      List listeners = (local?localListeners:remoteListeners);
        for (int ix = 0; ix < listeners.size(); ix++)
        {
          try
          {
            JetspeedCacheEventListener listener = (JetspeedCacheEventListener)listeners.get(ix);
            switch (action)
            {
              case CacheElement.ActionAdded:
                listener.notifyElementAdded(this,local, key,value);
                break;
              case CacheElement.ActionChanged:
                listener.notifyElementChanged(this,local, key,value);
                break;
              case CacheElement.ActionRemoved:
                listener.notifyElementRemoved(this,local, key,value);
                break;
              case CacheElement.ActionEvicted:
                listener.notifyElementEvicted(this,local, key,value);
                break;
              case CacheElement.ActionExpired:
                listener.notifyElementExpired(this,local, key,value);
                break;
            }
          }
          catch (Exception e)
          {
View Full Code Here

      List listeners = (local?localListeners:remoteListeners);
        for (int ix = 0; ix < listeners.size(); ix++)
        {
          try
          {
            JetspeedCacheEventListener listener = (JetspeedCacheEventListener)listeners.get(ix);
            switch (action)
            {
              case CacheElement.ActionAdded:
                listener.notifyElementAdded(this,local, key,value);
                break;
              case CacheElement.ActionChanged:
                listener.notifyElementChanged(this,local, key,value);
                break;
              case CacheElement.ActionRemoved:
                listener.notifyElementRemoved(this,local, key,value);
                break;
              case CacheElement.ActionEvicted:
                listener.notifyElementEvicted(this,local, key,value);
                break;
              case CacheElement.ActionExpired:
                listener.notifyElementExpired(this,local, key,value);
                break;
            }
          }
          catch (Exception e)
          {
View Full Code Here

        DatabasePageManagerCache.pathCache = pathCache;
        constraintsEnabled = pageManager.getConstraintsEnabled();
        permissionsEnabled = pageManager.getPermissionsEnabled();
       
        // setup local oid cache listener
        oidCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // infuse node with page manager configuration
                // or the page manager itself and add to the
                // paths cache
                node.setConstraintsEnabled(constraintsEnabled);
                node.setPermissionsEnabled(permissionsEnabled);
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).setPageManager(pageManager);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementChanged(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementChanged(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // infuse node with page manager configuration
                // or the page manager itself and add to the
                // paths cache
                node.setConstraintsEnabled(constraintsEnabled);
                node.setPermissionsEnabled(permissionsEnabled);
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).setPageManager(pageManager);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementEvicted(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementEvicted(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementExpired(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementExpired(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementRemoved(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementRemoved(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }
        }, true);
       
        // setup remote path cache listener
        pathCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(final JetspeedCache cache, final boolean local, final Object key, final Object element)
View Full Code Here

     *
     * @param listener the event listener
     */
    public void addListener(final FileCacheEventListener listener)
    {
        JetspeedCacheEventListener cacheEventListener = new JetspeedCacheEventListener()
        {
            public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

View Full Code Here

     *
     * @param listener the event listener
     */
    public void removeListener(final FileCacheEventListener listener)
    {
        JetspeedCacheEventListener cacheEventListener = listeners.remove(listener);
        if (cacheEventListener != null)
        {
            this.cache.removeEventListener(cacheEventListener, true);
        }
    }
View Full Code Here

        List listeners = (local?localListeners:remoteListeners);
        for (int ix = 0; ix < listeners.size(); ix++)
        {
            try
            {
                JetspeedCacheEventListener listener = (JetspeedCacheEventListener)listeners.get(ix);
                switch (action)
                {
                    case CacheElement.ActionAdded:
                        listener.notifyElementAdded(this,local, key,value);
                        break;
                    case CacheElement.ActionChanged:
                        listener.notifyElementChanged(this,local, key,value);
                        break;
                    case CacheElement.ActionRemoved:
                        listener.notifyElementRemoved(this,local, key,value);
                        break;
                    case CacheElement.ActionEvicted:
                        listener.notifyElementEvicted(this,local, key,value);
                        break;
                    case CacheElement.ActionExpired:
                        listener.notifyElementExpired(this,local, key,value);
                        break;
                }
            }
            catch (Exception e)
            {
View Full Code Here

        DatabasePageManagerCache.pathCache = pathCache;
        constraintsEnabled = pageManager.getConstraintsEnabled();
        permissionsEnabled = pageManager.getPermissionsEnabled();
       
        // setup local oid cache listener
        oidCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // infuse node with page manager configuration
                // or the page manager itself and add to the
                // paths cache
                node.setConstraintsEnabled(constraintsEnabled);
                node.setPermissionsEnabled(permissionsEnabled);
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).setPageManager(pageManager);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementChanged(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementChanged(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // infuse node with page manager configuration
                // or the page manager itself and add to the
                // paths cache
                node.setConstraintsEnabled(constraintsEnabled);
                node.setPermissionsEnabled(permissionsEnabled);
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).setPageManager(pageManager);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementEvicted(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementEvicted(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementExpired(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementExpired(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }

            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementRemoved(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementRemoved(final JetspeedCache cache, final boolean local, final Object key, final Object element)
            {
                final NodeImpl node = (NodeImpl)element;
                // reset internal FolderImpl caches
                if (node instanceof FolderImpl)
                {
                    ((FolderImpl)node).resetAll(false);
                }
            }
        }, true);
       
        // setup remote path cache listener
        pathCache.addEventListener(new JetspeedCacheEventListener()
        {
            /* (non-Javadoc)
             * @see org.apache.jetspeed.cache.JetspeedCacheEventListener#notifyElementAdded(org.apache.jetspeed.cache.JetspeedCache, boolean, java.lang.Object, java.lang.Object)
             */
            public void notifyElementAdded(final JetspeedCache cache, final boolean local, final Object key, final Object element)
View Full Code Here

     *
     * @param listener the event listener
     */
    public void addListener(final FileCacheEventListener listener)
    {
        JetspeedCacheEventListener cacheEventListener = new JetspeedCacheEventListener()
        {
            public void notifyElementRemoved(JetspeedCache cache, boolean local, Object key, Object element)
            {
            }

View Full Code Here

TOP

Related Classes of org.apache.jetspeed.cache.JetspeedCacheEventListener

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.