portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r896119 [1/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/ components/jetspeed-page-man...
Date Tue, 05 Jan 2010 16:32:49 GMT
Author: rwatler
Date: Tue Jan  5 16:32:47 2010
New Revision: 896119

URL: http://svn.apache.org/viewvc?rev=896119&view=rev
Log:
DBPM implementation of Scoped Fragment Properties
-------------------------------------------------------------
- added properties local and distributed caches to the DBPM cache implementation
- added OJB aware callbacks to Fragment implementation to link FragmentPropertyLists into Page update and remove operations
- cached FragmentPropertyLists per thread to ensure object coherence during request
- added FragmentPropertyList support to DBPM transaction rollback cache eviction processing
- refined existing DBPM cache operation to eliminate accidental cache eviction on update


Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/TransactionedOperation.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/DatabasePageManagerServer.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/ehcache.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/cache-test.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/assembly/cache-test.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-profiler/src/test/resources/cache-test.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/test/resources/cache-test.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-security/src/test/resources/cache-test.xml
    portals/jetspeed-2/portal/trunk/components/jetspeed-sso/src/test/resources/cache-test.xml
    portals/jetspeed-2/portal/trunk/etc/import/assembly/import-page-manager.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/cache.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/db-ojb/distributed-ehcache.xml
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/db-ojb/ehcache.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/BaseFragmentElementImpl.java Tue Jan  5 16:32:47 2010
@@ -782,7 +782,7 @@
             DatabasePageManager pageManager = getPageManager();
             if (pageManager != null)
             {
-                FragmentPropertyList properties = pageManager.getFragmentPropertiesList(this, fragmentProperties);
+                FragmentPropertyList properties = pageManager.getFragmentPropertyList(this, fragmentProperties);
                 fragmentProperties = null;
                 return properties;
             }
@@ -1083,7 +1083,7 @@
         DatabasePageManager pageManager = getPageManager();
         if (pageManager != null)
         {
-            pageManager.updateFragmentPropertiesList(this, PageManager.ALL_PROPERTY_SCOPE, fragmentProperties);
+            pageManager.updateFragmentPropertyList(this, PageManager.ALL_PROPERTY_SCOPE, fragmentProperties);
             fragmentProperties = null;
         }
     }
@@ -1105,7 +1105,7 @@
         DatabasePageManager pageManager = getPageManager();
         if (pageManager != null)
         {
-            pageManager.updateFragmentPropertiesList(this, PageManager.ALL_PROPERTY_SCOPE, fragmentProperties);
+            pageManager.updateFragmentPropertyList(this, PageManager.ALL_PROPERTY_SCOPE, fragmentProperties);
             fragmentProperties = null;
         }
     }
@@ -1120,7 +1120,7 @@
         DatabasePageManager pageManager = getPageManager();
         if (pageManager != null)
         {
-            pageManager.removeFragmentPropertiesList(this, fragmentProperties);
+            pageManager.removeFragmentPropertyList(this, fragmentProperties);
             fragmentProperties = null;
         }
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/impl/FragmentPropertyList.java Tue Jan  5 16:32:47 2010
@@ -21,7 +21,6 @@
 import java.util.Iterator;
 import java.util.List;
 
-import org.apache.jetspeed.om.page.BaseFragmentElement;
 import org.apache.jetspeed.om.page.FragmentProperty;
 
 /**
@@ -32,12 +31,12 @@
  */
 public class FragmentPropertyList extends AbstractList
 {
-    private BaseFragmentElement fragment;
+    private BaseFragmentElementImpl fragment;
 
     private List properties;
     private List removedProperties;
 
-    public FragmentPropertyList(BaseFragmentElement fragment)
+    public FragmentPropertyList(BaseFragmentElementImpl fragment)
     {
         super();
         this.properties = new ArrayList();
@@ -139,7 +138,7 @@
      * 
      * @return fragment owner
      */
-    public BaseFragmentElement getFragment()
+    public BaseFragmentElementImpl getFragmentImpl()
     {
         return fragment;
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManager.java Tue Jan  5 16:32:47 2010
@@ -166,11 +166,11 @@
     
     private PageManager pageManagerProxy;
 
-    public DatabasePageManager(String repositoryPath, IdGenerator generator, boolean isPermissionsSecurity, boolean isConstraintsSecurity, JetspeedCache oidCache, JetspeedCache pathCache)
+    public DatabasePageManager(String repositoryPath, IdGenerator generator, boolean isPermissionsSecurity, boolean isConstraintsSecurity, JetspeedCache oidCache, JetspeedCache pathCache, JetspeedCache propertiesCache, JetspeedCache propertiesPathCache)
     {
         super(repositoryPath);
         delegator = new DelegatingPageManager(generator, isPermissionsSecurity, isConstraintsSecurity, modelClasses);
-        DatabasePageManagerCache.cacheInit(oidCache, pathCache, this);
+        DatabasePageManagerCache.cacheInit(oidCache, pathCache, propertiesCache, propertiesPathCache, this);
     }
 
     /**
@@ -1414,7 +1414,7 @@
                 newFragmentsElement[0] = false;
             }
             
-            // return parent folder to update is caches after update
+            // return parent folder to update its caches after update
             return parent;
         }
         catch (PageNotUpdatedException pnue)
@@ -1606,15 +1606,7 @@
                 }
 
                 // create root folder or update folder and mark cache transaction
-                storeEntity(folder, folderPath);
-                if (newFolder && (folderImpl.getIdentity() != 0))
-                {
-                    DatabasePageManagerCache.addTransaction(new TransactionedOperation(folderPath, TransactionedOperation.ADD_OPERATION));
-                }
-                else
-                {
-                    DatabasePageManagerCache.addTransaction(new TransactionedOperation(folderPath, TransactionedOperation.UPDATE_OPERATION));
-                }
+                storeEntity(folder, folderPath, (newFolder && (folderImpl.getIdentity() != 0)));
 
                 // reset parent folder folders cache in case
                 // parent is holding an out of date copy of
@@ -2622,13 +2614,30 @@
             {
                 throw new PageNotUpdatedException("Properties for transient fragment cannot be updated");
             }
-            
-            // check access
-            boolean checkEditAccess = ((scope == null) || !scope.equals(USER_PROPERTY_SCOPE));
-            baseFragmentElementImpl.checkAccess(checkEditAccess ? JetspeedActions.EDIT : JetspeedActions.VIEW);
 
-            // update fragment properties
-            updateFragmentPropertiesList(baseFragmentElementImpl, scope, null);
+            // update lists only if not global or all scope
+            if ((scope != null) && !scope.equals(ALL_PROPERTY_SCOPE))
+            {
+                // check access
+                boolean checkEditAccess = !scope.equals(USER_PROPERTY_SCOPE);
+                baseFragmentElementImpl.checkAccess(checkEditAccess ? JetspeedActions.EDIT : JetspeedActions.VIEW);
+
+                // update fragment properties
+                updateFragmentPropertyList(baseFragmentElementImpl, scope, null);
+            }
+            else
+            {
+                // update entire page 
+                BaseFragmentsElementImpl baseFragmentsElementImpl = ((baseFragmentElementImpl != null) ? baseFragmentElementImpl.getBaseFragmentsElement() : null);
+                if (baseFragmentsElementImpl != null)
+                {
+                    updateFragmentsElement(baseFragmentsElementImpl, new boolean[]{false});
+                }
+                else
+                {
+                    throw new PageNotUpdatedException("Unable to update fragment properties: no owning page");
+                }
+            }
         }
         catch (PageNotUpdatedException pnue)
         {
@@ -2651,14 +2660,30 @@
      * @param transientList transient fragment property list
      * @return new or cached fragment property list
      */
-    public FragmentPropertyList getFragmentPropertiesList(BaseFragmentElementImpl baseFragmentElementImpl, FragmentPropertyList transientList)
+    public FragmentPropertyList getFragmentPropertyList(BaseFragmentElementImpl baseFragmentElementImpl, FragmentPropertyList transientList)
     {
         // access thread local fragment property lists cache
-        String threadLocalCacheKey = getFragmentPropertiesListThreadLocalCacheKey(baseFragmentElementImpl);
+        String cacheKey = getFragmentPropertyListCacheKey(baseFragmentElementImpl);
         Map threadLocalCache = (Map)fragmentPropertyListsCache.get();
 
         // get cached persistent list
-        FragmentPropertyList list = ((threadLocalCache != null) ? (FragmentPropertyList)threadLocalCache.get(threadLocalCacheKey) : null);
+        FragmentPropertyList list = ((threadLocalCache != null) ? (FragmentPropertyList)threadLocalCache.get(cacheKey) : null);
+        if (list == null)
+        {
+            // lookup fragment property list in cache
+            list = DatabasePageManagerCache.fragmentPropertyListCacheLookup(cacheKey);
+            
+            // save fragment property list in thread local cache
+            if (list != null)
+            {
+                if (threadLocalCache == null)
+                {
+                    threadLocalCache = new HashMap();
+                    fragmentPropertyListsCache.set(threadLocalCache);
+                }
+                threadLocalCache.put(cacheKey, list);
+            }
+        }
         if (list == null)
         {
             // use transient list or create new fragment property list
@@ -2729,7 +2754,10 @@
                 threadLocalCache = new HashMap();
                 fragmentPropertyListsCache.set(threadLocalCache);
             }
-            threadLocalCache.put(threadLocalCacheKey, list);
+            threadLocalCache.put(cacheKey, list);
+
+            // save fragment property list in cache
+            DatabasePageManagerCache.fragmentPropertyListCacheAdd(cacheKey, list, false, false);
         }
         else if (transientList != null)
         {
@@ -2777,23 +2805,37 @@
      * @param scope fragment property scope to update
      * @param transientList transient fragment property list
      */
-    public void updateFragmentPropertiesList(BaseFragmentElementImpl baseFragmentElementImpl, String scope, FragmentPropertyList transientList)
+    public void updateFragmentPropertyList(BaseFragmentElementImpl baseFragmentElementImpl, String scope, FragmentPropertyList transientList)
     {
         // update persistent list
-        FragmentPropertyList list = getFragmentPropertiesList(baseFragmentElementImpl, transientList);
+        FragmentPropertyList list = getFragmentPropertyList(baseFragmentElementImpl, transientList);
         if (list != null)
         {
             // update fragment properties in list in database
             boolean updateAllScopes = ((scope != null) && scope.equals(ALL_PROPERTY_SCOPE));
             synchronized (list)
             {
+                // store property objects for add/update
+                boolean update = false;
+                boolean sharedUpdate = false;
                 Iterator propertiesIter = list.getProperties().iterator();
                 while (propertiesIter.hasNext())
                 {
                     FragmentPropertyImpl storeProperty = (FragmentPropertyImpl)propertiesIter.next();
                     storeProperty.setFragment(baseFragmentElementImpl);
-                    if (updateAllScopes || ((scope == null) && (storeProperty.getScope() == null)) || ((scope != null) && scope.equals(storeProperty.getScope())))
+                    String storePropertyScope = storeProperty.getScope();
+                    if (updateAllScopes || ((scope == null) && (storePropertyScope == null)) || ((scope != null) && scope.equals(storePropertyScope)))
                     {
+                        // track operation type
+                        if (storeProperty.getIdentity() != 0)
+                        {
+                            update = true;
+                        }
+                        if ((storePropertyScope == null) || !storePropertyScope.equals(USER_PROPERTY_SCOPE))
+                        {
+                            sharedUpdate = true;
+                        }
+                        // store property object
                         getPersistenceBrokerTemplate().store(storeProperty);
                     }
                 }
@@ -2805,12 +2847,26 @@
                     {
                         FragmentPropertyImpl deleteProperty = (FragmentPropertyImpl)removedPropertiesIter.next();
                         deleteProperty.setFragment(baseFragmentElementImpl);
-                        if (updateAllScopes || ((scope == null) && (deleteProperty.getScope() == null)) || ((scope != null) && scope.equals(deleteProperty.getScope())))
+                        String deletePropertyScope = deleteProperty.getScope();
+                        if (updateAllScopes || ((scope == null) && (deletePropertyScope == null)) || ((scope != null) && scope.equals(deletePropertyScope)))
                         {
+                            // track operation type
+                            update = true;
+                            if ((deletePropertyScope == null) || !deletePropertyScope.equals(USER_PROPERTY_SCOPE))
+                            {
+                                sharedUpdate = true;
+                            }
+                            // delete property object
                             getPersistenceBrokerTemplate().delete(deleteProperty);
                         }
                     }
                 }
+                
+                // interoperate with cache to signal update operations and
+                // record thread transactions
+                String cacheKey = getFragmentPropertyListCacheKey(baseFragmentElementImpl);
+                String transactionOperationPath = DatabasePageManagerCache.fragmentPropertyListCacheAdd(cacheKey, list, (update || sharedUpdate), sharedUpdate);
+                DatabasePageManagerCache.addTransaction(new TransactionedOperation(transactionOperationPath, (update ? TransactionedOperation.UPDATE_FRAGMENT_PROPERTIES_OPERATION : TransactionedOperation.ADD_FRAGMENT_PROPERTIES_OPERATION)));
             }
         }
     }
@@ -2821,18 +2877,18 @@
      * @param baseFragmentElementImpl fragment element
      * @param transientList transient fragment property list
      */
-    public void removeFragmentPropertiesList(BaseFragmentElementImpl baseFragmentElementImpl, FragmentPropertyList transientList)
+    public void removeFragmentPropertyList(BaseFragmentElementImpl baseFragmentElementImpl, FragmentPropertyList transientList)
     {
         // access thread local fragment property lists cache
-        String threadLocalCacheKey = getFragmentPropertiesListThreadLocalCacheKey(baseFragmentElementImpl);
+        String cacheKey = getFragmentPropertyListCacheKey(baseFragmentElementImpl);
         Map threadLocalCache = (Map)fragmentPropertyListsCache.get();
 
         // remove cached persistent list
-        FragmentPropertyList list = ((threadLocalCache != null) ? (FragmentPropertyList)threadLocalCache.get(threadLocalCacheKey) : null);
+        FragmentPropertyList list = ((threadLocalCache != null) ? (FragmentPropertyList)threadLocalCache.get(cacheKey) : null);
         if (list != null)
         {
             // remove list from cache
-            threadLocalCache.remove(threadLocalCacheKey);
+            threadLocalCache.remove(cacheKey);
             // cleanup list
             synchronized (list)
             {
@@ -2864,6 +2920,10 @@
         filter.addEqualTo("fragment", new Integer(baseFragmentElementImpl.getIdentity()));
         QueryByCriteria query = QueryFactory.newQuery(FragmentPropertyImpl.class, filter);
         getPersistenceBrokerTemplate().deleteByQuery(query);
+        
+        // interoperate with cache to signal remove operations
+        String path = baseFragmentElementImpl.getBaseFragmentsElement().getPath();
+        DatabasePageManagerCache.fragmentPropertyListCacheRemove(path);
     }
     
     /**
@@ -2872,7 +2932,7 @@
      * @param baseFragmentElementImpl owner of fragment properties
      * @return key string
      */
-    private static String getFragmentPropertiesListThreadLocalCacheKey(BaseFragmentElementImpl baseFragmentElementImpl)
+    private static String getFragmentPropertyListCacheKey(BaseFragmentElementImpl baseFragmentElementImpl)
     {
         // base key
         String key = baseFragmentElementImpl.getBaseFragmentsElement().getPath()+"/"+baseFragmentElementImpl.getId();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/DatabasePageManagerCache.java Tue Jan  5 16:32:47 2010
@@ -17,16 +17,21 @@
 package org.apache.jetspeed.page.impl;
 
 import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.jetspeed.cache.CacheElement;
 import org.apache.jetspeed.cache.JetspeedCache;
 import org.apache.jetspeed.cache.JetspeedCacheEventListener;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.folder.impl.FolderImpl;
+import org.apache.jetspeed.om.page.impl.FragmentPropertyList;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.document.impl.NodeImpl;
 import org.apache.ojb.broker.Identity;
@@ -45,6 +50,9 @@
     
     private static JetspeedCache oidCache;
     private static JetspeedCache pathCache;
+    private static JetspeedCache propertiesCache;
+    private static JetspeedCache propertiesPathCache;
+    private static Map propertiesCacheIndexMap;
     private static boolean constraintsEnabled;
     private static boolean permissionsEnabled;
     private static PageManager pageManager;
@@ -60,11 +68,14 @@
      *
      * @param pageManager configured page manager
      */
-    public synchronized static void cacheInit(final JetspeedCache oidCache, final JetspeedCache pathCache, final DatabasePageManager pageManager)
+    public synchronized static void cacheInit(final JetspeedCache oidCache, final JetspeedCache pathCache, final JetspeedCache propertiesCache, final JetspeedCache propertiesPathCache, final DatabasePageManager pageManager)
     {
         // initialize
         DatabasePageManagerCache.oidCache = oidCache;
         DatabasePageManagerCache.pathCache = pathCache;
+        DatabasePageManagerCache.propertiesCache = propertiesCache;
+        DatabasePageManagerCache.propertiesPathCache = propertiesPathCache;
+        propertiesCacheIndexMap = new HashMap();
         constraintsEnabled = pageManager.getConstraintsEnabled();
         permissionsEnabled = pageManager.getPermissionsEnabled();
         
@@ -90,13 +101,7 @@
              */
             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);
-                node.setPageManager(pageManager);
+                notifyElementAdded(cache, local, key, element);
             }
 
             /* (non-Javadoc)
@@ -104,12 +109,7 @@
              */
             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);
-                }
+                notifyElementRemoved(cache, local, key, element);
             }
 
             /* (non-Javadoc)
@@ -117,12 +117,7 @@
              */
             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);
-                }
+                notifyElementRemoved(cache, local, key, element);
             }
 
             /* (non-Javadoc)
@@ -210,6 +205,21 @@
                                 {
                                     ((FolderImpl)parentNode).resetAll(false);
                                 }
+                                // remove all indexed cache keys for page path from
+                                // properties cache index
+                                Set index = (Set)propertiesCacheIndexMap.get(path);
+                                if (index != null)
+                                {
+                                    // remove all indexed cache keys
+                                    Iterator cacheKeyIter = index.iterator();
+                                    while (cacheKeyIter.hasNext())
+                                    {
+                                        String cacheKey = (String)cacheKeyIter.next();
+                                        propertiesCache.removeQuiet(cacheKey);
+                                        propertiesPathCache.removeQuiet(cacheKey);
+                                    }
+                                    propertiesCacheIndexMap.remove(path);
+                                }
                                 // ensure removed from cache
                                 pathCache.removeQuiet(path);
                             }
@@ -218,6 +228,182 @@
                 }
             }
         }, 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(final JetspeedCache cache, final boolean local, final Object key, final Object element)
+            {
+                final String cacheKey = (String)key;
+                final FragmentPropertyList fragmentPropertyList = (FragmentPropertyList)element;
+                if (fragmentPropertyList != null)
+                {
+                    // add cache key to properties cache index
+                    final String path = fragmentPropertyList.getFragmentImpl().getBaseFragmentsElement().getPath();
+                    synchronized (DatabasePageManagerCache.class)
+                    {
+                        Set index = (Set)propertiesCacheIndexMap.get(path);
+                        if (index == null)
+                        {
+                            index = new HashSet();
+                            propertiesCacheIndexMap.put(path, index);
+                        }
+                        index.add(cacheKey);
+                    }
+                }
+            }
+
+            /* (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)
+            {
+                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(final JetspeedCache cache, final boolean local, final Object key, final 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(final JetspeedCache cache, final boolean local, final Object key, final 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(final JetspeedCache cache, final boolean local, final Object key, final Object element)
+            {
+                final String cacheKeyOrPath = (String)key;
+                final FragmentPropertyList fragmentPropertyList = (FragmentPropertyList)element;
+                if (fragmentPropertyList != null)
+                {
+                    // remove single cache key from properties cache index
+                    final String path = fragmentPropertyList.getFragmentImpl().getBaseFragmentsElement().getPath();
+                    synchronized (DatabasePageManagerCache.class)
+                    {
+                        Set index = (Set)propertiesCacheIndexMap.get(path);
+                        if (index != null)
+                        {
+                            index.remove(cacheKeyOrPath);
+                            if (index.isEmpty())
+                            {
+                                propertiesCacheIndexMap.remove(path);
+                            }
+                        }
+                    }
+                }
+                else if (cacheKeyOrPath != null)
+                {
+                    // remove all indexed cache keys from properties cache index
+                    synchronized (DatabasePageManagerCache.class)
+                    {
+                        Set index = (Set)propertiesCacheIndexMap.get(cacheKeyOrPath);
+                        if (index != null)
+                        {
+                            // remove all indexed cache keys
+                            Iterator cacheKeyIter = index.iterator();
+                            while (cacheKeyIter.hasNext())
+                            {
+                                String cacheKey = (String)cacheKeyIter.next();
+                                propertiesCache.removeQuiet(cacheKey);
+                            }
+                            propertiesCacheIndexMap.remove(cacheKeyOrPath);
+                        }
+                    }                    
+                }
+                else if (cacheKeyOrPath != 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(final JetspeedCache cache, final boolean local, final Object key, final 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(final JetspeedCache cache, final boolean local, final Object key, final 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(final JetspeedCache cache, final boolean local, final Object key, final 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(final JetspeedCache cache, final boolean local, final Object key, final 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(final JetspeedCache cache, final boolean local, final Object key, final Object element)
+            {
+                final DatabasePageManagerCacheObject cacheObject = (DatabasePageManagerCacheObject)element;
+                // remove cache object from local properties cache
+                if (cacheObject != null)
+                {
+                    final String cacheKeyOrPath = cacheObject.getPath();
+                    if (cacheKeyOrPath != null)
+                    {
+                        synchronized (DatabasePageManagerCache.class)
+                        {
+                            // find all indexed cache keys for path
+                            Set index = (Set)propertiesCacheIndexMap.get(cacheKeyOrPath);
+                            if (index != null)
+                            {
+                                // remove all indexed cache keys
+                                Set indexClone = new HashSet(index);
+                                Iterator cacheKeyIter = indexClone.iterator();
+                                while (cacheKeyIter.hasNext())
+                                {
+                                    String cacheKey = (String)cacheKeyIter.next();
+                                    propertiesCache.remove(cacheKey);
+                                    propertiesPathCache.removeQuiet(cacheKey);
+                                }
+                            }
+                            else
+                            {
+                                // assume path is cache key to remove
+                                propertiesCache.remove(cacheKeyOrPath);
+                                propertiesPathCache.removeQuiet(cacheKeyOrPath);
+                            }
+                        }
+                    }
+                }
+            }
+        }, false);
     }
 
     /**
@@ -284,26 +470,30 @@
         if (obj instanceof NodeImpl)
         {
             final NodeImpl node = (NodeImpl)obj;
-            final String nodePath = node.getPath();
+            final String path = node.getPath();
 
             // add node to caches; note that removes force notification
             // of update to distributed caches
             oidCache.remove(oid);
-            final CacheElement element = oidCache.createElement(oid, node);
-            oidCache.put(element);
-            final boolean removed = pathCache.remove(nodePath);
-            final CacheElement pathElement = pathCache.createElement(nodePath, new DatabasePageManagerCacheObject(oid, nodePath));
+            final boolean removed = pathCache.remove(path);
+            final CacheElement pathElement = pathCache.createElement(path, new DatabasePageManagerCacheObject(oid, path));
             pathCache.put(pathElement);
             // if a remove was not successful from the path cache, update
             // notification to distributed peers was not performed;
             // for updates of objects evicted from the cache or newly
             // created ones, this is problematic: remove and put into
             // path cache a second time to force
-            if (!removed && updatePathsList.contains(nodePath))
+            if (!removed && updatePathsList.contains(path))
             {
-                pathCache.remove(nodePath);
+                pathCache.remove(path);
                 pathCache.put(pathElement);
             }
+            // add node to local oid cache by key after removes from
+            // distributed path cache since those removes will remove
+            // from local oid cache in notifications, (despite the
+            // 'local' listener registration)
+            final CacheElement element = oidCache.createElement(oid, node);
+            oidCache.put(element);
         }
     }
 
@@ -323,23 +513,33 @@
      */
     public synchronized static void cacheClear()
     {
-        // remove all items from oid cache individually
-        // to ensure notifications are run to detach
-        // elements; do not invoke oidCache.clear()
+        // remove all items from oid and properties caches
+        // individually to ensure notifications are run to
+        // detach elements; do not invoke JetspeedCache.clear()
         final Iterator removeOidIter = oidCache.getKeys().iterator();
         while (removeOidIter.hasNext())
         {
             oidCache.remove((Identity)removeOidIter.next());
         }
-        // remove all items from path cache individually
+        final Iterator removePropertiesIter = propertiesCache.getKeys().iterator();
+        while (removePropertiesIter.hasNext())
+        {
+            propertiesCache.remove(removePropertiesIter.next());
+        }
+        // remove all items from path caches individually
         // to avoid potential distributed clear invocation
         // that would be performed against all peers; do
-        // not invoke pathCache.clear()
+        // not invoke JetspeedCache.clear()
         final Iterator removePathIter = pathCache.getKeys().iterator();
         while (removePathIter.hasNext())
         {
             pathCache.removeQuiet(removePathIter.next());
         }
+        final Iterator removePropertiesPathIter = propertiesPathCache.getKeys().iterator();
+        while (removePropertiesPathIter.hasNext())
+        {
+            propertiesPathCache.removeQuiet(removePropertiesPathIter.next());
+        }
     }
 
     /**
@@ -375,20 +575,20 @@
             final NodeImpl node = (NodeImpl)cacheLookup(oid);
             if (node != null)
             {
-                final String nodePath = node.getPath();
+                final String path = node.getPath();
                 // remove from caches; note that removes are
                 // propagated to distributed caches
                 oidCache.remove(oid);
-                final boolean removed = pathCache.remove(nodePath);
+                final boolean removed = pathCache.remove(path);
                 // if a remove was not successful from the path cache,
                 // remove notification to distributed peers was not
                 // performed; this is problematic: put into path cache
                 // and remove a second time to force
                 if (!removed)
                 {
-                    final CacheElement pathElement = pathCache.createElement(nodePath, new DatabasePageManagerCacheObject(oid, nodePath));
+                    final CacheElement pathElement = pathCache.createElement(path, new DatabasePageManagerCacheObject(oid, path));
                     pathCache.put(pathElement);
-                    pathCache.remove(nodePath);
+                    pathCache.remove(path);
                 }
             }
         }
@@ -441,6 +641,103 @@
     }
     
     /**
+     * Add new or update cached fragment property list.
+     * 
+     * @param cacheKey cache key for fragment property list
+     * @param fragmentPropertyList fragment property list
+     * @param update flag indicating update
+     * @param sharedUpdate flag indicating shared property update that requires path cache eviction
+     * @return transaction operation path
+     */
+    public synchronized static String fragmentPropertyListCacheAdd(String cacheKey, FragmentPropertyList fragmentPropertyList, boolean update, boolean sharedUpdate)
+    {
+        // remove locally cached fragment lists by cache key or
+        // path based on update scope
+        final String path = fragmentPropertyList.getFragmentImpl().getBaseFragmentsElement().getPath();
+        final String updatePathOrCacheKey = ((update && sharedUpdate) ? path : cacheKey);
+        propertiesCache.remove(updatePathOrCacheKey);
+        // update remote caches by cache key or path
+        if (update)
+        {
+            // perform remote update via path or cache key depending
+            // on scope of update operation
+            final boolean removed = propertiesPathCache.remove(updatePathOrCacheKey);
+            // if a remove was not successful from the path cache, update
+            // notification to distributed peers was not performed;
+            // for updates of objects evicted from the cache or newly
+            // created ones, this is problematic: put into path cache a
+            // and remove a second time to force
+            if (!removed)
+            {
+                final CacheElement propertiesPathElement = propertiesPathCache.createElement(updatePathOrCacheKey, new DatabasePageManagerCacheObject(updatePathOrCacheKey));
+                propertiesPathCache.put(propertiesPathElement);
+                propertiesPathCache.remove(updatePathOrCacheKey);
+            }
+        }
+        // ensure cache key in properties path cache
+        if (propertiesPathCache.get(cacheKey) == null)
+        {
+            final CacheElement propertiesPathElement = propertiesPathCache.createElement(cacheKey, new DatabasePageManagerCacheObject(cacheKey));
+            propertiesPathCache.put(propertiesPathElement);
+        }
+        // add fragment properties list to local cache by key after
+        // removes from distributed path cache since those removes
+        // will remove from local cache in notifications, (despite the
+        // 'local' listener registration)
+        final CacheElement propertiesElement = propertiesCache.createElement(cacheKey, fragmentPropertyList);
+        propertiesCache.put(propertiesElement);
+        // return update path or cache key as transaction operation path
+        return updatePathOrCacheKey;
+    }
+    
+    /**
+     * Lookup fragment property list by cache key.
+     * 
+     * @param cacheKey cache key for fragment property list
+     * @return fragment property list
+     */
+    public synchronized static FragmentPropertyList fragmentPropertyListCacheLookup(String cacheKey)
+    {
+        // return fragment properties list cached locally by key
+        if (cacheKey != null)
+        {
+            final CacheElement propertiesElement = propertiesCache.get(cacheKey);
+            if (propertiesElement != null)
+            {
+                return (FragmentPropertyList)propertiesElement.getContent();
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Remove fragment property list from local and remote caches.
+     * 
+     * @param cacheKeyOrPath cache key or path for fragment property list
+     */
+    public synchronized static void fragmentPropertyListCacheRemove(String cacheKeyOrPath)
+    {
+        // remove fragment properties list cached locally by key
+        // and notify remote caches by cache key or path
+        if (cacheKeyOrPath != null)
+        {
+            propertiesCache.remove(cacheKeyOrPath);
+            final boolean removed = propertiesPathCache.remove(cacheKeyOrPath);
+            // if a remove was not successful from the path cache, update
+            // notification to distributed peers was not performed;
+            // for updates of objects evicted from the cache, this is
+            // problematic: put into path cache and remove a second time
+            // to force notification
+            if (!removed)
+            {
+                final CacheElement propertiesPathElement = propertiesPathCache.createElement(cacheKeyOrPath, new DatabasePageManagerCacheObject(cacheKeyOrPath));
+                propertiesPathCache.put(propertiesPathElement);
+                propertiesPathCache.remove(cacheKeyOrPath);                
+            }
+        }
+    }
+
+    /**
      * Get transactions registered on current thread
      * 
      * @return transactions list
@@ -476,7 +773,16 @@
         while (transactions.hasNext())
         {
             final TransactionedOperation operation = (TransactionedOperation)transactions.next();
-            cacheRemove(operation.getPath());
+            if ((operation.getTransactionType() == TransactionedOperation.ADD_OPERATION) ||
+                (operation.getTransactionType() == TransactionedOperation.UPDATE_OPERATION))
+            {
+                cacheRemove(operation.getPath());
+            }
+            else if ((operation.getTransactionType() == TransactionedOperation.ADD_FRAGMENT_PROPERTIES_OPERATION) ||
+                     (operation.getTransactionType() == TransactionedOperation.UPDATE_FRAGMENT_PROPERTIES_OPERATION))
+            {
+                fragmentPropertyListCacheRemove(operation.getPath());
+            }
         }
     }
 
@@ -495,7 +801,7 @@
      */
     public static boolean isDistributed()
     {
-        return pathCache.isDistributed();
+        return (pathCache.isDistributed() && propertiesPathCache.isDistributed());
     }
 
     // OJB Constructor

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/TransactionedOperation.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/TransactionedOperation.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/TransactionedOperation.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/impl/TransactionedOperation.java Tue Jan  5 16:32:47 2010
@@ -30,6 +30,8 @@
 {
     public static final int ADD_OPERATION = 0;
     public static final int UPDATE_OPERATION = 1;
+    public static final int ADD_FRAGMENT_PROPERTIES_OPERATION = 2;
+    public static final int UPDATE_FRAGMENT_PROPERTIES_OPERATION = 3;
     private String path;
     private int transactionType;
     

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/PageManagerTestShared.java Tue Jan  5 16:32:47 2010
@@ -98,9 +98,9 @@
  * @version $Id: $
  *          
  */
-interface PageManagerTestShared
+public interface PageManagerTestShared
 {
-    class Shared
+    public class Shared
     {
         /**
          * makeCastorXMLPageManager
@@ -847,7 +847,7 @@
         }
     }
     
-    static class AbstractTestPrincipal extends TransientJetspeedPrincipal
+    public static abstract class AbstractTestPrincipal extends TransientJetspeedPrincipal
     {
         private static final SecurityAttributeTypes attributeTypes = new SecurityAttributeTypes()
         {
@@ -905,14 +905,13 @@
             };
         }
 
-        @Override
         public synchronized JetspeedPrincipalType getType()
         {
             return type;
         }
     }
     
-    static class TestUser extends AbstractTestPrincipal implements User
+    public static class TestUser extends AbstractTestPrincipal implements User
     {
         private static final long serialVersionUID = 1L;
 
@@ -922,7 +921,7 @@
         }
     }
 
-    static class TestGroup extends AbstractTestPrincipal implements Group
+    public static class TestGroup extends AbstractTestPrincipal implements Group
     {
         private static final long serialVersionUID = 1L;
 
@@ -932,7 +931,7 @@
         }
     }
     
-    static class TestRole extends AbstractTestPrincipal implements Role
+    public static class TestRole extends AbstractTestPrincipal implements Role
     {
         private static final long serialVersionUID = 1L;
 
@@ -942,7 +941,7 @@
         }
     }
     
-    static class TestPermissionFactory implements PermissionFactory
+    public static class TestPermissionFactory implements PermissionFactory
     {
         private static Map<String, JetspeedPermissionFactory> factories = new HashMap<String, JetspeedPermissionFactory>();
         static

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/DatabasePageManagerServer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/DatabasePageManagerServer.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/DatabasePageManagerServer.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/DatabasePageManagerServer.java Tue Jan  5 16:32:47 2010
@@ -19,17 +19,26 @@
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
+import java.security.PrivilegedAction;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.security.auth.Subject;
 
 import org.apache.commons.jexl.JexlContext;
 import org.apache.commons.jexl.JexlHelper;
 import org.apache.commons.jexl.Script;
 import org.apache.commons.jexl.ScriptFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.apache.jetspeed.components.JetspeedBeanDefinitionFilter;
 import org.apache.jetspeed.components.SpringComponentManager;
 import org.apache.jetspeed.components.jndi.JetspeedTestJNDIComponent;
 import org.apache.jetspeed.page.PageManager;
+import org.apache.jetspeed.page.PageManagerTestShared;
+import org.apache.jetspeed.security.JSSubject;
+import org.apache.jetspeed.security.PrincipalsSet;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * DatabasePageManagerServer
@@ -53,6 +62,10 @@
     private PageManager pageManager;
     private JexlContext jexlContext;
     private boolean exit;
+    private String user;
+    private String groups;
+    private String roles;
+    private Subject userSubject;
     
     // Life cycle
     
@@ -81,7 +94,7 @@
         // access page manager
         pageManager = (PageManager)scm.getComponent("pageManager");
         
-        // craete jexl context
+        // create jexl context
         jexlContext = JexlHelper.createContext();
         jexlContext.getVars().put("pageManager", pageManager);
         jexlContext.getVars().put("pageManagerServer", this);
@@ -129,7 +142,7 @@
         }
         catch (final Exception e)
         {
-            resultLine += " -> "+e;            
+            resultLine += " -> "+e;
         }
         return resultLine;
     }
@@ -145,6 +158,8 @@
     // Data access
     
     /**
+     * Get server exit flag.
+     * 
      * @return server exit flag
      */
     public boolean isExit()
@@ -152,6 +167,101 @@
         return exit;
     }
     
+    /**
+     * Get user principal name.
+     * 
+     * @return user principal name
+     */
+    public String getUser()
+    {
+        return user;
+    }
+    
+    /**
+     * Set user principal name.
+     * 
+     * @param user user principal name
+     */
+    public void setUser(String user)
+    {
+        this.user = user;
+        this.userSubject = null;
+    }
+    
+    /**
+     * Get user group principal names.
+     * 
+     * @return CSV list of group principal names
+     */
+    public String getGroups()
+    {
+        return groups;
+    }
+
+    /**
+     * Set user group principal names.
+     * 
+     * @param groups CSV list of group principal names
+     */
+    public void setGroups(String groups)
+    {
+        this.groups = groups;
+        this.userSubject = null;
+    }
+
+    /**
+     * Get user role principal names.
+     * 
+     * @return CSV list of role principal names
+     */
+    public String getRoles()
+    {
+        return roles;
+    }
+
+    /**
+     * Set user role principal names.
+     * 
+     * @param roles CSV list of role principal names
+     */
+    public void setRoles(String roles)
+    {
+        this.roles = roles;
+        this.userSubject = null;
+    }
+
+    /**
+     * Get or create and cache user subject.
+     * 
+     * @return user subject
+     */
+    public Subject getUserSubject()
+    {
+        if ((userSubject == null) && (user != null))
+        {
+            Set userPrincipals = new PrincipalsSet();
+            userPrincipals.add(new PageManagerTestShared.TestUser(user));
+            if (groups != null)
+            {
+                String [] groupsArray = groups.split(",");
+                for (int i = 0; (i < groupsArray.length); i++)
+                {
+                    userPrincipals.add(new PageManagerTestShared.TestGroup(groupsArray[i].trim()));                                    
+                }
+            }
+            if (roles != null)
+            {
+                String [] rolesArray = roles.split(",");
+                for (int i = 0; (i < rolesArray.length); i++)
+                {
+                    userPrincipals.add(new PageManagerTestShared.TestRole(rolesArray[i].trim()));                                    
+                }
+            }
+            userSubject = new Subject(true, userPrincipals, new HashSet(), new HashSet());            
+        }
+        return userSubject;
+    }
+    
     // Application entry point
     
     /**
@@ -181,8 +291,43 @@
                     String resultLine = "";
                     if (scriptLine.length() > 0)
                     {
-                        // execute script
-                        resultLine = server.execute(scriptLine);
+                        // get user and execute script
+                        Subject userSubject = server.getUserSubject();
+                        if (userSubject != null)
+                        {                            
+                            // execute script as user
+                            final String executeScriptLine = scriptLine;
+                            final String [] executeResultLine = new String[]{null};
+                            Exception executeException = (Exception)JSSubject.doAsPrivileged(userSubject, new PrivilegedAction()
+                            {
+                                public Object run()
+                                {
+                                    try
+                                    {
+                                        executeResultLine[0] = server.execute(executeScriptLine);
+                                        return null;
+                                    }
+                                    catch (Exception e)
+                                    {
+                                        return e;
+                                    }
+                                    finally
+                                    {
+                                        JSSubject.clearSubject();
+                                    }
+                                }
+                            }, null);
+                            if (executeException != null)
+                            {
+                                throw executeException;
+                            }
+                            resultLine = executeResultLine[0];
+                        }
+                        else
+                        {
+                            // execute script anonymously
+                            resultLine = server.execute(scriptLine);
+                        }
                     }
 
                     // write prefixed single line results

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java Tue Jan  5 16:32:47 2010
@@ -33,9 +33,11 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.jetspeed.cache.impl.EhCacheConfigResource;
+import org.apache.jetspeed.om.page.FragmentProperty;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.apache.jetspeed.cache.impl.EhCacheConfigResource;
 
 /**
  * TestDatabasePageManagerCache
@@ -135,8 +137,28 @@
             assertTrue(!result.contains("Exception"));
             result = server1.execute("pageManager.reset();");
             assertTrue(!result.contains("Exception"));
+
+            // login servers setting test user, group, and role principal names
+            result = server0.execute("pageManagerServer.setUser(\"user\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManagerServer.setGroup(\"group\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManagerServer.setRole(\"role\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManagerServer.setUser(\"user\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManagerServer.setGroup(\"group\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManagerServer.setRole(\"role\");");
+            assertTrue(!result.contains("Exception"));
             
-            // create folder and documents in first page manager
+            // reset request cache
+            result = server0.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
+            
+            // create folders, documents, and properties in first page manager
             result = server0.execute("folder = pageManager.newFolder(\"/\");");
             assertTrue(!result.contains("Exception"));
             result = server0.execute("folder.setTitle(\"Root Folder\");");
@@ -147,12 +169,28 @@
             assertTrue(!result.contains("Exception"));
             result = server0.execute("page.setTitle(\"Default Page\");");
             assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment = page.getRootFragment();");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment.setTitle(\"Default Page Root Fragment\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment.setState(\"DEFAULT\");");
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("pageManager.updatePage(page);");
             assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment.setState(\""+FragmentProperty.USER_PROPERTY_SCOPE+"\", null, \"USER\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updateFragmentProperties(fragment, \""+FragmentProperty.USER_PROPERTY_SCOPE+"\");");
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("page = pageManager.newPage(\"/another-page.psml\");");
             assertTrue(!result.contains("Exception"));
             result = server0.execute("page.setTitle(\"Another Page\");");
             assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment = page.getRootFragment();");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment.setTitle(\"Another Page Root Fragment\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment.setState(\"DEFAULT\");");
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("pageManager.updatePage(page);");
             assertTrue(!result.contains("Exception"));
             result = server0.execute("page = pageManager.newPage(\"/some-other-page.psml\");");
@@ -197,14 +235,25 @@
             assertTrue(!result.contains("Exception"));
             result = server0.execute("pageManager.updatePageSecurity(pageSecurity);");
             assertTrue(!result.contains("Exception"));
+            
+            // wait for cache notifications to propagate between servers
+            Thread.sleep(500);
 
-            // populate folders and documents in second page manager
+            // populate folders, documents, and properties in second page manager
             result = server1.execute("pageManager.getFolder(\"/\").getTitle();");
             assertTrue(result.endsWith("Root Folder"));
             result = server1.execute("pageManager.getPage(\"/default-page.psml\").getTitle();");
             assertTrue(result.endsWith("Default Page"));
+            result = server1.execute("pageManager.getPage(\"/default-page.psml\").getRootFragment().getTitle();");
+            assertTrue(result.endsWith("Default Page Root Fragment"));
+            result = server1.execute("pageManager.getPage(\"/default-page.psml\").getRootFragment().getState();");
+            assertTrue(result.endsWith("USER"));
             result = server1.execute("pageManager.getPage(\"/another-page.psml\").getTitle();");
             assertTrue(result.endsWith("Another Page"));
+            result = server1.execute("pageManager.getPage(\"/another-page.psml\").getRootFragment().getTitle();");
+            assertTrue(result.endsWith("Another Page Root Fragment"));
+            result = server1.execute("pageManager.getPage(\"/another-page.psml\").getRootFragment().getState();");
+            assertTrue(result.endsWith("DEFAULT"));
             result = server1.execute("pageManager.getPage(\"/some-other-page.psml\").getTitle();");
             assertTrue(result.endsWith("Some Other Page"));            
             result = server1.execute("pageManager.getLink(\"/default.link\").getTitle();");
@@ -220,13 +269,21 @@
             result = server1.execute("pageManager.getPageSecurity().getPath();");
             assertTrue(result.endsWith("/page.security"));
             
-            // update/remove objects in second page manager
+            // update/remove objects and properties in second page manager
             result = server1.execute("page = pageManager.getPage(\"/default-page.psml\");");
             assertTrue(!result.contains("Exception"));
             result = server1.execute("page.setTitle(\"Edited Default Page\");");
             assertTrue(!result.contains("Exception"));
             result = server1.execute("pageManager.updatePage(page);");
             assertTrue(!result.contains("Exception"));
+            result = server1.execute("page = pageManager.getPage(\"/another-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("fragment = page.getRootFragment();");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("fragment.setState(\"DEFAULT2\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
             result = server1.execute("page = pageManager.getPage(\"/some-other-page.psml\");");
             assertTrue(!result.contains("Exception"));
             result = server1.execute("pageManager.removePage(page);");
@@ -246,11 +303,17 @@
             result = server1.execute("folder = pageManager.getFolder(\"/deep-1\");");
             assertTrue(!result.contains("Exception"));
             result = server1.execute("pageManager.removeFolder(folder);");
-            assertTrue(!result.contains("Exception"));            
+            assertTrue(!result.contains("Exception"));
+            
+            // reset request cache
+            result = server1.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
             
-            // test objects in both page managers for cache coherency
+            // test objects and properties in both page managers for cache coherence
             result = server1.execute("pageManager.getPage(\"/default-page.psml\").getTitle();");
             assertTrue(result.endsWith("Edited Default Page"));
+            result = server1.execute("pageManager.getPage(\"/another-page.psml\").getRootFragment().getState();");
+            assertTrue(result.endsWith("DEFAULT2"));
             result = server1.execute("pageManager.getPage(\"/some-other-page.psml\");");
             assertTrue(result.contains("PageNotFoundException"));
             result = server1.execute("pageManager.getFolder(\"/\").getPages().size();");
@@ -266,6 +329,7 @@
             result = server1.execute("pageManager.getFolder(\"/\").getFolders().size();");
             assertTrue(result.endsWith("1"));
             boolean defaultPageUpdated = false;
+            boolean anotherPageStateUpdated = false;
             boolean someOtherPageRemoved = false;
             boolean rootFolderPagesCountTwo = false;
             boolean defaultLinkUpdated = false;
@@ -276,12 +340,21 @@
             long coherencyCheckStarted = System.currentTimeMillis();
             do
             {
-                // check cache coherency
+                // reset request cache
+                result = server0.execute("pageManager.cleanupRequestCache();");
+                assertTrue(!result.contains("Exception"));
+
+                // check cache coherence
                 if (!defaultPageUpdated)
                 {
                     result = server0.execute("pageManager.getPage(\"/default-page.psml\").getTitle();");
                     defaultPageUpdated = result.endsWith("Edited Default Page");
                 }
+                if (!anotherPageStateUpdated)
+                {
+                    result = server0.execute("pageManager.getPage(\"/another-page.psml\").getRootFragment().getState();");
+                    anotherPageStateUpdated = result.endsWith("DEFAULT2");
+                }
                 if (!someOtherPageRemoved)
                 {
                     result = server0.execute("pageManager.getPage(\"/some-other-page.psml\");");
@@ -318,14 +391,15 @@
                     rootFolderFoldersCountOne = result.endsWith("1");
                 }
                 
-                // wait for cache coherency
-                if (!defaultPageUpdated || !someOtherPageRemoved || !rootFolderPagesCountTwo || !defaultLinkUpdated || !deep0FolderUpdated || !deepPage1Removed || !deep1FolderRemoved || !rootFolderFoldersCountOne)
+                // wait for cache coherence
+                if (!defaultPageUpdated || !anotherPageStateUpdated || !someOtherPageRemoved || !rootFolderPagesCountTwo || !defaultLinkUpdated || !deep0FolderUpdated || !deepPage1Removed || !deep1FolderRemoved || !rootFolderFoldersCountOne)
                 {
                     Thread.sleep(250);
                 }
             }
-            while ((!defaultPageUpdated || !someOtherPageRemoved || !rootFolderPagesCountTwo || !defaultLinkUpdated || !deep0FolderUpdated || !deepPage1Removed || !deep1FolderRemoved || !rootFolderFoldersCountOne) && (System.currentTimeMillis()-coherencyCheckStarted < 5000));
+            while ((!defaultPageUpdated || !anotherPageStateUpdated || !someOtherPageRemoved || !rootFolderPagesCountTwo || !defaultLinkUpdated || !deep0FolderUpdated || !deepPage1Removed || !deep1FolderRemoved || !rootFolderFoldersCountOne) && (System.currentTimeMillis()-coherencyCheckStarted < 5000));
             assertTrue(defaultPageUpdated);
+            assertTrue(anotherPageStateUpdated);
             assertTrue(someOtherPageRemoved);
             assertTrue(rootFolderPagesCountTwo);
             assertTrue(defaultLinkUpdated);
@@ -334,21 +408,41 @@
             assertTrue(deep1FolderRemoved);
             assertTrue(rootFolderFoldersCountOne);
 
-            // add new objects in first page manager
+            // reset request cache
+            result = server0.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
+            
+            // update properties/add new objects in first page manager
+            result = server0.execute("page = pageManager.getPage(\"/default-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment = page.getRootFragment();");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("fragment.setState(\""+FragmentProperty.USER_PROPERTY_SCOPE+"\", null, \"USER2\");");
+            assertTrue(!result.contains("Exception"));            
+            result = server0.execute("pageManager.updateFragmentProperties(fragment, \""+FragmentProperty.USER_PROPERTY_SCOPE+"\");");
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("page = pageManager.newPage(\"/new-page.psml\");");
-            assertTrue(result.indexOf("Exception") == -1);
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("page.setTitle(\"New Page\");");
-            assertTrue(result.indexOf("Exception") == -1);
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("pageManager.updatePage(page);");
-            assertTrue(result.indexOf("Exception") == -1);
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("folder = pageManager.newFolder(\"/deep-2\");");
-            assertTrue(result.indexOf("Exception") == -1);
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("folder.setTitle(\"Deep 2 Folder\");");
-            assertTrue(result.indexOf("Exception") == -1);
+            assertTrue(!result.contains("Exception"));
             result = server0.execute("pageManager.updateFolder(folder);");
-            assertTrue(result.indexOf("Exception") == -1);
+            assertTrue(!result.contains("Exception"));
+            
+            // reset request cache
+            result = server0.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
             
-            // test objects in both page managers for cache coherency
+            // test objects in both page managers for cache coherence
+            result = server0.execute("pageManager.getPage(\"/default-page.psml\").getRootFragment().getState();");
+            assertTrue(result.endsWith("USER2"));
             result = server0.execute("pageManager.getFolder(\"/\").getPages().size();");
             assertTrue(result.endsWith("3"));
             result = server0.execute("pageManager.getFolder(\"/\").getFolders().size();");
@@ -357,6 +451,7 @@
             assertTrue(result.endsWith("New Page"));
             result = server0.execute("pageManager.getFolder(\"/deep-2\").getTitle();");
             assertTrue(result.endsWith("Deep 2 Folder"));
+            boolean defaultPageUserStateUpdated = false;
             boolean rootFolderPagesCountThree = false;
             boolean rootFolderFoldersCountTwo = false;
             boolean newPageCreated = false;
@@ -364,7 +459,16 @@
             coherencyCheckStarted = System.currentTimeMillis();
             do
             {
-                // check cache coherency
+                // reset request cache
+                result = server1.execute("pageManager.cleanupRequestCache();");
+                assertTrue(!result.contains("Exception"));
+                
+                // check cache coherence
+                if (!defaultPageUserStateUpdated)
+                {
+                    result = server1.execute("pageManager.getPage(\"/default-page.psml\").getRootFragment().getState();");
+                    defaultPageUserStateUpdated = result.endsWith("USER2");                    
+                }
                 if (!rootFolderPagesCountThree)
                 {
                     result = server1.execute("pageManager.getFolder(\"/\").getPages().size();");
@@ -386,17 +490,30 @@
                     deep2FolderCreated = result.endsWith("Deep 2 Folder");
                 }
 
-                // wait for cache coherency
-                if (!rootFolderPagesCountThree || !rootFolderFoldersCountTwo || !newPageCreated || !deep2FolderCreated)
+                // wait for cache coherence
+                if (!defaultPageUserStateUpdated || !rootFolderPagesCountThree || !rootFolderFoldersCountTwo || !newPageCreated || !deep2FolderCreated)
                 {
                     Thread.sleep(250);
                 }
             }
-            while ((!rootFolderPagesCountThree || !rootFolderFoldersCountTwo || !newPageCreated || !deep2FolderCreated) && (System.currentTimeMillis()-coherencyCheckStarted < 5000));
+            while ((!defaultPageUserStateUpdated || !rootFolderPagesCountThree || !rootFolderFoldersCountTwo || !newPageCreated || !deep2FolderCreated) && (System.currentTimeMillis()-coherencyCheckStarted < 5000));
+            assertTrue(defaultPageUserStateUpdated);
             assertTrue(rootFolderPagesCountThree);
             assertTrue(rootFolderFoldersCountTwo);
             assertTrue(newPageCreated);
             assertTrue(deep2FolderCreated);
+            
+            // reset request cache
+            result = server0.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.cleanupRequestCache();");
+            assertTrue(!result.contains("Exception"));
+            
+            // return servers to anonymous mode
+            result = server0.execute("pageManagerServer.setUser(null);");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManagerServer.setUser(null);");
+            assertTrue(!result.contains("Exception"));            
 
             // reset database page managers
             result = server0.execute("pageManager.reset();");

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml Tue Jan  5 16:32:47 2010
@@ -46,6 +46,16 @@
         <property name="cacheName" value="pageManagerPathCache"/>
     </bean>
     
+    <bean id="ehPageManagerPropertiesCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPropertiesCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPropertiesPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPropertiesPathCache"/>
+    </bean>
+    
     <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
         <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
     </bean>
@@ -54,6 +64,14 @@
         <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
     </bean>
     
+    <bean id="pageManagerPropertiesCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <constructor-arg><ref bean="ehPageManagerPropertiesCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPropertiesPathCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <constructor-arg><ref bean="ehPageManagerPropertiesPathCache"/></constructor-arg>
+    </bean>
+    
     <!-- Transaction Proxying -->
     <bean id="pageManagerInterceptor" class="org.apache.jetspeed.util.interceptors.PageManagerInterceptor">
         <!--

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml Tue Jan  5 16:32:47 2010
@@ -35,6 +35,10 @@
         <constructor-arg index="4"><ref bean="pageManagerOidCache"/></constructor-arg>
         <!-- folder/page/link path cache -->
         <constructor-arg index="5"><ref bean="pageManagerPathCache"/></constructor-arg>
+        <!-- fragment properties cache -->
+        <constructor-arg index="6"><ref bean="pageManagerPropertiesCache"/></constructor-arg>
+        <!-- fragment properties path cache -->
+        <constructor-arg index="7"><ref bean="pageManagerPropertiesPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml Tue Jan  5 16:32:47 2010
@@ -66,6 +66,29 @@
                                                replicateRemovals=true"/>
     </cache>
 
+    <cache name="pageManagerPropertiesCache"
+           maxElementsInMemory="${org.apache.jetspeed.ehcache.pagemanager.maxelements}"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           timeToLiveSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           memoryStoreEvictionPolicy="LFU"/>
+
+    <cache name="pageManagerPropertiesPathCache"
+           maxElementsInMemory="${org.apache.jetspeed.ehcache.pagemanager.maxelements}"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           timeToLiveSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           memoryStoreEvictionPolicy="LFU">
+        <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
+                                   properties="replicateAsynchronously=true,
+                                               replicatePuts=false,
+                                               replicateUpdates=false,
+                                               replicateUpdatesViaCopy=false,
+                                               replicateRemovals=true"/>
+    </cache>
+
     <cache name="pageFileCache"
            maxElementsInMemory="${org.apache.jetspeed.ehcache.pagemanager.maxfiles}"
            eternal="false"

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/ehcache.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/ehcache.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/ehcache.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/ehcache.xml Tue Jan  5 16:32:47 2010
@@ -48,6 +48,22 @@
            timeToLiveSeconds="150"
            memoryStoreEvictionPolicy="LFU"/>
 
+    <cache name="pageManagerPropertiesCache"
+           maxElementsInMemory="128"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="150"
+           timeToLiveSeconds="150"
+           memoryStoreEvictionPolicy="LFU"/>
+
+    <cache name="pageManagerPropertiesPathCache"
+           maxElementsInMemory="128"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="150"
+           timeToLiveSeconds="150"
+           memoryStoreEvictionPolicy="LFU"/>
+
     <cache name="pageFileCache"
            maxElementsInMemory="100"
            eternal="false"

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml Tue Jan  5 16:32:47 2010
@@ -35,6 +35,10 @@
         <constructor-arg index="4"><ref bean="pageManagerOidCache"/></constructor-arg>
         <!-- folder/page/link path cache -->
         <constructor-arg index="5"><ref bean="pageManagerPathCache"/></constructor-arg>
+        <!-- fragment properties cache -->
+        <constructor-arg index="6"><ref bean="pageManagerPropertiesCache"/></constructor-arg>
+        <!-- fragment properties path cache -->
+        <constructor-arg index="7"><ref bean="pageManagerPropertiesPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml Tue Jan  5 16:32:47 2010
@@ -35,6 +35,10 @@
         <constructor-arg index="4"><ref bean="pageManagerOidCache"/></constructor-arg>
         <!-- folder/page/link path cache -->
         <constructor-arg index="5"><ref bean="pageManagerPathCache"/></constructor-arg>
+        <!-- fragment properties cache -->
+        <constructor-arg index="6"><ref bean="pageManagerPropertiesCache"/></constructor-arg>
+        <!-- fragment properties path cache -->
+        <constructor-arg index="7"><ref bean="pageManagerPropertiesPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/cache-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/cache-test.xml?rev=896119&r1=896118&r2=896119&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/cache-test.xml (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal-site/src/test/resources/cache-test.xml Tue Jan  5 16:32:47 2010
@@ -276,6 +276,18 @@
         <property name="cacheName" value="pageManagerPathCache"/>
     </bean>
     
+    <bean id="ehPageManagerPropertiesCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default or cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPropertiesCache"/>
+    </bean>
+
+    <bean id="ehPageManagerPropertiesPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default or cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPropertiesPathCache"/>
+    </bean>
+
     <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
         <meta key="j2:cat" value="default or cache"/>
         <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
@@ -286,4 +298,14 @@
         <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
     </bean>
     
+    <bean id="pageManagerPropertiesCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default or cache"/>
+        <constructor-arg><ref bean="ehPageManagerPropertiesCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPropertiesPathCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default or cache"/>
+        <constructor-arg><ref bean="ehPageManagerPropertiesPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message