portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r733549 - in /portals/jetspeed-2/portal/branches/JPA_BRANCH/components: jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/ jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/ jetspeed-page-manager/src/ma...
Date Mon, 12 Jan 2009 00:14:39 GMT
Author: rwatler
Date: Sun Jan 11 16:14:38 2009
New Revision: 733549

URL: http://svn.apache.org/viewvc?rev=733549&view=rev
Log:
JPA DBPM/Registry Integration
----------------------------------
- add and utilize common JPA implementation utilites for OM collection creation and distributed cache listeners
- implement distributed cache listeners for registery PortletApplications and PortletDefinitions


Added:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/JPAUtils.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPADistributedCacheListener.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPARemoteCommitListener.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/OpenJPAPortletRegistryImpl.java
Removed:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/DatabasePageManagerUtils.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPARemoteCommitListenerImpl.java
Modified:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderMenuDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentPreferenceImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageMenuDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/SecurityConstraintsDefImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/pom.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityAccessComponentImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/PortletPreferencesProviderImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SupportsImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderBaseMenuDefinitionMetadata.java Sun Jan 11 16:14:38 2009
@@ -30,10 +30,10 @@
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.page.PageMetadataImpl;
 import org.apache.jetspeed.om.page.jpa.MetadataLocalizedFieldCollection;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * FolderBaseMenuDefinitionMetadata
@@ -85,7 +85,7 @@
         {
             if (metadataFields == null)
             {
-                metadataFields = DatabasePageManagerUtils.createList();
+                metadataFields = JPAUtils.createList();
             }
             pageMetadata = newPageMetadata(new MetadataLocalizedFieldCollection(this, metadataFields));
         }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java Sun Jan 11 16:14:38 2009
@@ -44,6 +44,7 @@
 import javax.persistence.Transient;
 
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraintsContext;
 import org.apache.jetspeed.om.folder.Folder;
@@ -73,7 +74,6 @@
 import org.apache.jetspeed.page.document.NodeSet;
 import org.apache.jetspeed.page.document.jpa.NodeImpl;
 import org.apache.jetspeed.page.document.jpa.NodeSetImpl;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 import org.apache.jetspeed.security.PermissionFactory;
 
 /**
@@ -235,7 +235,7 @@
         // create initial collection if necessary
         if (metadataFields == null)
         {
-            metadataFields = DatabasePageManagerUtils.createList();
+            metadataFields = JPAUtils.createList();
         }
         // wrap collection to maintain JPA inverse relationships
         return new MetadataLocalizedFieldCollection(this, metadataFields);        
@@ -278,7 +278,7 @@
         // create initial collection if necessary
         if (orders == null)
         {
-            orders = DatabasePageManagerUtils.createList();
+            orders = JPAUtils.createList();
         }
         return orders;
     }
@@ -295,7 +295,7 @@
         // create initial collection if necessary
         if (menus == null)
         {
-            menus = DatabasePageManagerUtils.createList();
+            menus = JPAUtils.createList();
         }
         return menus;
     }
@@ -1441,7 +1441,7 @@
         // create initial collection if necessary
         if (constraintsRefs == null)
         {
-            constraintsRefs = DatabasePageManagerUtils.createList();
+            constraintsRefs = JPAUtils.createList();
         }
         return constraintsRefs;
     }
@@ -1454,7 +1454,7 @@
         // create initial collection if necessary
         if (constraints == null)
         {
-            constraints = DatabasePageManagerUtils.createList();
+            constraints = JPAUtils.createList();
         }
         return constraints;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderMenuDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderMenuDefinitionImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderMenuDefinitionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderMenuDefinitionImpl.java Sun Jan 11 16:14:38 2009
@@ -36,10 +36,10 @@
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.folder.MenuDefinition;
 import org.apache.jetspeed.om.folder.jpa.FolderImpl;
 import org.apache.jetspeed.om.page.PageMetadataImpl;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * FolderMenuDefinitionImpl
@@ -137,7 +137,7 @@
         // create initial collection if necessary
         if (elements == null)
         {
-            elements = DatabasePageManagerUtils.createList();
+            elements = JPAUtils.createList();
         }
         return elements;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentImpl.java Sun Jan 11 16:14:38 2009
@@ -41,13 +41,13 @@
 import javax.persistence.Transient;
 
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraintsContext;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.PageSecurity;
 import org.apache.jetspeed.page.jpa.DatabasePageManager;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 import org.apache.jetspeed.security.PermissionFactory;
 
 /**
@@ -245,7 +245,7 @@
         // create initial collection if necessary
         if (fragments == null)
         {
-            fragments = DatabasePageManagerUtils.createList();
+            fragments = JPAUtils.createList();
         }
         return fragments;
     }
@@ -262,7 +262,7 @@
         // create initial collection if necessary
         if (preferences == null)
         {
-            preferences = DatabasePageManagerUtils.createList();
+            preferences = JPAUtils.createList();
         }
         return preferences;
     }
@@ -1352,7 +1352,7 @@
         // create initial collection if necessary
         if (constraintsRefs == null)
         {
-            constraintsRefs = DatabasePageManagerUtils.createList();
+            constraintsRefs = JPAUtils.createList();
         }
         return constraintsRefs;
     }
@@ -1365,7 +1365,7 @@
         // create initial collection if necessary
         if (constraints == null)
         {
-            constraints = DatabasePageManagerUtils.createList();
+            constraints = JPAUtils.createList();
         }
         return constraints;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentPreferenceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentPreferenceImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentPreferenceImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/FragmentPreferenceImpl.java Sun Jan 11 16:14:38 2009
@@ -35,8 +35,8 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.preference.FragmentPreference;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * FragmentPreferenceImpl
@@ -104,7 +104,7 @@
         // create initial collection if necessary
         if (values == null)
         {
-            values = DatabasePageManagerUtils.createList();
+            values = JPAUtils.createList();
         }
         return values;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java Sun Jan 11 16:14:38 2009
@@ -37,6 +37,7 @@
 import javax.persistence.PostLoad;
 import javax.persistence.Table;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.folder.jpa.FolderImpl;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraintsContext;
@@ -44,7 +45,6 @@
 import org.apache.jetspeed.om.page.PageMetadataImpl;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.jpa.DocumentImpl;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * LinkImpl
@@ -141,7 +141,7 @@
         // create initial collection if necessary
         if (metadataFields == null)
         {
-            metadataFields = DatabasePageManagerUtils.createList();
+            metadataFields = JPAUtils.createList();
         }
         // wrap collection to maintain JPA inverse relationships
         return new MetadataLocalizedFieldCollection(this, metadataFields);        
@@ -361,7 +361,7 @@
         // create initial collection if necessary
         if (constraintsRefs == null)
         {
-            constraintsRefs = DatabasePageManagerUtils.createList();
+            constraintsRefs = JPAUtils.createList();
         }
         return constraintsRefs;
     }
@@ -374,7 +374,7 @@
         // create initial collection if necessary
         if (constraints == null)
         {
-            constraints = DatabasePageManagerUtils.createList();
+            constraints = JPAUtils.createList();
         }
         return constraints;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageBaseMenuDefinitionMetadata.java Sun Jan 11 16:14:38 2009
@@ -30,9 +30,9 @@
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.page.PageMetadataImpl;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * PageBaseMenuDefinitionMetadata
@@ -84,7 +84,7 @@
         {
             if (metadataFields == null)
             {
-                metadataFields = DatabasePageManagerUtils.createList();
+                metadataFields = JPAUtils.createList();
             }
             pageMetadata = newPageMetadata(new MetadataLocalizedFieldCollection(this, metadataFields));
         }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java Sun Jan 11 16:14:38 2009
@@ -39,6 +39,7 @@
 import javax.persistence.Transient;
 
 import org.apache.jetspeed.JetspeedActions;
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraintsContext;
 import org.apache.jetspeed.om.folder.Folder;
@@ -54,7 +55,6 @@
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.jpa.DocumentImpl;
 import org.apache.jetspeed.page.jpa.DatabasePageManager;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * PageImpl
@@ -169,7 +169,7 @@
         // create initial collection if necessary
         if (metadataFields == null)
         {
-            metadataFields = DatabasePageManagerUtils.createList();
+            metadataFields = JPAUtils.createList();
         }
         // wrap collection to maintain JPA inverse relationships
         return new MetadataLocalizedFieldCollection(this, metadataFields);        
@@ -212,7 +212,7 @@
         // create initial collection if necessary
         if (menus == null)
         {
-            menus = DatabasePageManagerUtils.createList();
+            menus = JPAUtils.createList();
         }
         return menus;
     }
@@ -389,7 +389,7 @@
             // root fragment and save for reuse
             if (this.fragment == null)
             {
-                this.fragment = DatabasePageManagerUtils.createList();
+                this.fragment = JPAUtils.createList();
             }
             else if (!this.fragment.isEmpty())
             {
@@ -696,7 +696,7 @@
         // create initial collection if necessary
         if (constraintsRefs == null)
         {
-            constraintsRefs = DatabasePageManagerUtils.createList();
+            constraintsRefs = JPAUtils.createList();
         }
         return constraintsRefs;
     }
@@ -709,7 +709,7 @@
         // create initial collection if necessary
         if (constraints == null)
         {
-            constraints = DatabasePageManagerUtils.createList();
+            constraints = JPAUtils.createList();
         }
         return constraints;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageMenuDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageMenuDefinitionImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageMenuDefinitionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageMenuDefinitionImpl.java Sun Jan 11 16:14:38 2009
@@ -36,9 +36,9 @@
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.folder.MenuDefinition;
 import org.apache.jetspeed.om.page.PageMetadataImpl;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * PageMenuDefinitionImpl
@@ -136,7 +136,7 @@
         // create initial collection if necessary
         if (elements == null)
         {
-            elements = DatabasePageManagerUtils.createList();
+            elements = JPAUtils.createList();
         }
         return elements;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java Sun Jan 11 16:14:38 2009
@@ -40,6 +40,7 @@
 import javax.persistence.Table;
 import javax.persistence.Transient;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.common.SecurityConstraint;
 import org.apache.jetspeed.om.common.SecurityConstraintsContext;
 import org.apache.jetspeed.om.folder.jpa.FolderImpl;
@@ -47,7 +48,6 @@
 import org.apache.jetspeed.om.page.SecurityConstraintsDef;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.page.document.jpa.DocumentImpl;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * PageSecurityImpl
@@ -175,7 +175,7 @@
         // create initial collection if necessary
         if (constraintsDefs == null)
         {
-            constraintsDefs = DatabasePageManagerUtils.createList();
+            constraintsDefs = JPAUtils.createList();
         }
         return constraintsDefs;
     }
@@ -192,7 +192,7 @@
         // create initial collection if necessary
         if (globalConstraintsRefs == null)
         {
-            globalConstraintsRefs = DatabasePageManagerUtils.createList();
+            globalConstraintsRefs = JPAUtils.createList();
         }
         return globalConstraintsRefs;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/SecurityConstraintsDefImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/SecurityConstraintsDefImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/SecurityConstraintsDefImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/SecurityConstraintsDefImpl.java Sun Jan 11 16:14:38 2009
@@ -35,8 +35,8 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.page.SecurityConstraintsDef;
-import org.apache.jetspeed.page.jpa.DatabasePageManagerUtils;
 
 /**
  * SecurityConstraintsDefImpl
@@ -101,7 +101,7 @@
         // create initial collection if necessary
         if (constraintDefs == null)
         {
-            constraintDefs = DatabasePageManagerUtils.createList();
+            constraintDefs = JPAUtils.createList();
         }
         return constraintDefs;
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerImpl.java Sun Jan 11 16:14:38 2009
@@ -16,13 +16,22 @@
  */
 package org.apache.jetspeed.page.jpa;
 
+import java.util.HashSet;
+import java.util.Set;
+
 import javax.persistence.EntityManager;
 
+import org.apache.jetspeed.components.rdbms.jpa.OpenJPADistributedCacheListener;
+import org.apache.jetspeed.components.rdbms.jpa.OpenJPARemoteCommitListener;
+import org.apache.jetspeed.om.folder.jpa.FolderImpl;
+import org.apache.jetspeed.om.page.jpa.LinkImpl;
+import org.apache.jetspeed.om.page.jpa.PageImpl;
+import org.apache.jetspeed.om.page.jpa.PageSecurityImpl;
+import org.apache.jetspeed.page.document.Node;
 import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.datacache.DataCache;
 import org.apache.openjpa.datacache.DataCacheManager;
 import org.apache.openjpa.event.RemoteCommitEventManager;
-import org.apache.openjpa.event.RemoteCommitListener;
 import org.apache.openjpa.event.RemoteCommitProvider;
 import org.apache.openjpa.event.SingleJVMRemoteCommitProvider;
 import org.apache.openjpa.persistence.EntityManagerImpl;
@@ -33,12 +42,16 @@
  * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
  * @version $Id: $
  */
-public class OpenJPADatabasePageManagerImpl extends DatabasePageManagerImpl
+public class OpenJPADatabasePageManagerImpl extends DatabasePageManagerImpl implements OpenJPADistributedCacheListener
 {
+    // Members
+    
     private RemoteCommitEventManager openJPAEventManager;
     private DataCache openJPASystemDataCache;
     private boolean distributed;
-    private RemoteCommitListener listener;
+    private OpenJPARemoteCommitListener listener;
+
+    // Constructor
     
     /**
      * Construct with permissions and constraints settings.
@@ -51,13 +64,7 @@
         super(isPermissionsSecurity, isConstraintsSecurity);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.page.PageManager#isDistributed()
-     */
-    public boolean isDistributed()
-    {
-        return distributed;
-    }
+    // Lifecycle
     
     /**
      * Initialize by registering an event listener.
@@ -86,7 +93,13 @@
         // register remote listener for distributed operation
         if ((openJPAEventManager != null) && (openJPASystemDataCache != null) && distributed)
         {
-            listener = new OpenJPARemoteCommitListenerImpl(this, openJPASystemDataCache);
+            // create listener for page manager entities
+            Set<Class> entityClasses = new HashSet<Class>();
+            entityClasses.add(FolderImpl.class);
+            entityClasses.add(PageImpl.class);
+            entityClasses.add(LinkImpl.class);
+            entityClasses.add(PageSecurityImpl.class);
+            listener = new OpenJPARemoteCommitListener(openJPASystemDataCache, entityClasses, this);
             // add as an internal listener to receive events
             // before underlying caches so that oids can be
             // looked up in the internal system caches
@@ -105,4 +118,23 @@
             openJPAEventManager.removeListener(listener);
         }
     }    
+
+    // Implementation
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.page.PageManager#isDistributed()
+     */
+    public boolean isDistributed()
+    {
+        return distributed;
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.rdbms.jpa.OpenJPADistributedCacheListener#notifyUpdatedEntity(java.lang.Object)
+     */
+    public void notifyUpdatedEntity(Object entity)
+    {
+        // notify page manager of updated node entity
+        notifyUpdatedNode((Node)entity);
+    }
 }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/pom.xml?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/pom.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/pom.xml Sun Jan 11 16:14:38 2009
@@ -73,6 +73,10 @@
       <scope>test</scope>
     </dependency>
     <dependency>
+      <groupId>org.apache.openjpa</groupId>
+      <artifactId>openjpa-persistence-jdbc</artifactId>
+    </dependency>        
+    <dependency>
       <groupId>${org.apache.jetspeed.test.jdbc.driver.groupId}</groupId>
       <artifactId>${org.apache.jetspeed.test.jdbc.driver.artifactId}</artifactId>
       <version>${org.apache.jetspeed.test.jdbc.driver.version}</version>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/JPAUtils.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/JPAUtils.java?rev=733549&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/JPAUtils.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/JPAUtils.java Sun Jan 11 16:14:38 2009
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.components.rdbms.jpa;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Vector;
+
+/**
+ * JPAUtils
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class JPAUtils<T>
+{
+    public static Collection createCollection()
+    {
+        // synchronized collection compatible with EntityManager.merge()
+        return new Vector();
+    }
+    
+    public static List createList()
+    {
+        // synchronized list compatible with EntityManager.merge()
+        return new Vector();
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPADistributedCacheListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPADistributedCacheListener.java?rev=733549&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPADistributedCacheListener.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPADistributedCacheListener.java Sun Jan 11 16:14:38 2009
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.components.rdbms.jpa;
+
+import javax.persistence.EntityManager;
+
+/**
+ * OpenJPADistributedCacheListener
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public interface OpenJPADistributedCacheListener
+{
+    /**
+     * Return entity manager in context of cache listener.
+     * 
+     * @return entity manager.
+     */
+    public abstract EntityManager getEntityManager();
+    
+    /**
+     * Notify listener that entity has been updated; entity
+     * will be null if it can not be determined or if event
+     * applies to all entities.
+     * 
+     * @param entity updated entity.
+     */
+    public void notifyUpdatedEntity(Object entity);
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPARemoteCommitListener.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPARemoteCommitListener.java?rev=733549&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPARemoteCommitListener.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPARemoteCommitListener.java Sun Jan 11 16:14:38 2009
@@ -0,0 +1,202 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.components.rdbms.jpa;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.openjpa.datacache.DataCache;
+import org.apache.openjpa.datacache.DataCachePCData;
+import org.apache.openjpa.event.RemoteCommitEvent;
+import org.apache.openjpa.event.RemoteCommitListener;
+
+/**
+ * OpenJPARemoteCommitListenerImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class OpenJPARemoteCommitListener implements RemoteCommitListener
+{
+    private static final Log log = LogFactory.getLog(OpenJPARemoteCommitListener.class);
+    
+    // Members
+
+    private DataCache openJPASystemDataCache;
+    private Set<Class> subscribedClasses;
+    private OpenJPADistributedCacheListener cacheListener;
+    
+    // Constructor
+    
+    /**
+     * Construct new OpenJPA remote commit listener on a openJPA system
+     * cache for a list of subscribed classes and a local distributed
+     * cache listener context.
+     * 
+     * @param openJPASystemDataCache OpenJPA system data cache.
+     * @param subscribedClasses list of subscribed classes.
+     * @param cacheListener local distributed cache listener.
+     */
+    public OpenJPARemoteCommitListener(DataCache openJPASystemDataCache, Set<Class> subscribedClasses, OpenJPADistributedCacheListener cacheListener)
+    {
+        this.openJPASystemDataCache = openJPASystemDataCache;
+        this.subscribedClasses = subscribedClasses;
+        this.cacheListener = cacheListener;
+    }
+    
+    // Implementation
+    
+    /* (non-Javadoc)
+     * @see org.apache.openjpa.event.RemoteCommitListener#afterCommit(org.apache.openjpa.event.RemoteCommitEvent)
+     */
+    public void afterCommit(RemoteCommitEvent event)
+    {
+        try
+        {
+            switch (event.getPayloadType())
+            {
+                case RemoteCommitEvent.PAYLOAD_OIDS_WITH_ADDS :
+                case RemoteCommitEvent.PAYLOAD_OIDS :
+                {
+                    // lookup oids in system cache if available
+                    if (openJPASystemDataCache != null)
+                    {
+                        // get payload delete/update oid/class pairs from event
+                        class PayloadOidClassPairData
+                        {
+                            Object payloadOid;
+                            Class payloadClass;
+                            Object payloadObject;
+                            PayloadOidClassPairData(Object payloadOid,Class payloadClass)
+                            {
+                                this.payloadOid = payloadOid;
+                                this.payloadClass = payloadClass;
+                            }
+                        }
+                        List<PayloadOidClassPairData> payloadOidClassPairsData = new ArrayList<PayloadOidClassPairData>();
+                        Collection deletedIds = event.getDeletedObjectIds();
+                        if (deletedIds != null)
+                        {
+                            for (Iterator iter = deletedIds.iterator(); iter.hasNext();)
+                            {
+                                DataCachePCData cacheData = openJPASystemDataCache.get(iter.next());
+                                if ((cacheData != null) && (cacheData.getId() != null) && (cacheData.getType() != null))
+                                {
+                                    payloadOidClassPairsData.add(new PayloadOidClassPairData(cacheData.getId(), cacheData.getType()));
+                                }
+                            }
+                        }
+                        Collection updatedIds = event.getUpdatedObjectIds();
+                        if (updatedIds != null)
+                        {
+                            for (Iterator iter = updatedIds.iterator(); iter.hasNext();)
+                            {
+                                DataCachePCData cacheData = openJPASystemDataCache.get(iter.next());
+                                if ((cacheData != null) && (cacheData.getId() != null) && (cacheData.getType() != null))
+                                {
+                                    payloadOidClassPairsData.add(new PayloadOidClassPairData(cacheData.getId(), cacheData.getType()));
+                                }
+                            }
+                        }
+
+                        // lookup payload objects, (will be detached in notification)
+                        if ((payloadOidClassPairsData != null) && !payloadOidClassPairsData.isEmpty())
+                        {
+                            // get transient entity manager for lookups
+                            EntityManager entityManager = cacheListener.getEntityManager();
+                            try
+                            {
+                                // lookup payload object from oid/class pair
+                                for (Iterator<PayloadOidClassPairData> iter = payloadOidClassPairsData.iterator(); iter.hasNext();)
+                                {
+                                    PayloadOidClassPairData data = iter.next();
+                                    // check class for subscribed types
+                                    if (subscribedClasses.contains(data.payloadClass))
+                                    {
+                                        data.payloadObject = entityManager.find(data.payloadClass, data.payloadOid);
+                                    }
+                                    // remove payload data if node not found
+                                    if (data.payloadObject == null)
+                                    {
+                                        iter.remove();
+                                    }
+                                }
+                            }
+                            finally
+                            {
+                                entityManager.close();
+                            }
+                        }
+                        
+                        // send updated notification for each node looked up
+                        // successfully or a single notification with an
+                        // unspecified update node
+                        if ((payloadOidClassPairsData != null) && !payloadOidClassPairsData.isEmpty())
+                        {
+                            for (PayloadOidClassPairData data : payloadOidClassPairsData)
+                            {
+                                cacheListener.notifyUpdatedEntity(data.payloadObject);
+                            }
+                        }
+                        else
+                        {
+                            cacheListener.notifyUpdatedEntity(null);
+                        }
+                    }
+                    else
+                    {
+                        // node instances not available: notify cache
+                        // listeners with unspecified updated node
+                        cacheListener.notifyUpdatedEntity(null);                                    
+                    }
+                }
+                break;
+                case RemoteCommitEvent.PAYLOAD_EXTENTS :
+                {
+                    // node instances not available: notify cache
+                    // listeners with unspecified updated node
+                    cacheListener.notifyUpdatedEntity(null);
+                }
+                break;
+                case RemoteCommitEvent.PAYLOAD_LOCAL_STALE_DETECTION :
+                default :
+                {
+                    // ignore local or unknown payloads.
+                }
+                break;
+            }
+        }
+        catch (Exception e)
+        {
+            log.error("Unexpected exception handling remote commit event: "+e, e);
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.openjpa.event.RemoteCommitListener#close()
+     */
+    public void close()
+    {
+    }                
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityAccessComponentImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityAccessComponentImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityAccessComponentImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityAccessComponentImpl.java Sun Jan 11 16:14:38 2009
@@ -99,7 +99,7 @@
      * 
      * @return entity manager.
      */
-    protected EntityManager getEntityManager()
+    public EntityManager getEntityManager()
     {
         return registryManager.getEntityManager();
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java Sun Jan 11 16:14:38 2009
@@ -16,8 +16,8 @@
  */
 package org.apache.jetspeed.components.portletpreferences.jpa;
 
-import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import javax.persistence.Basic;
 import javax.persistence.CascadeType;
@@ -35,6 +35,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.pluto.internal.InternalPortletPreference;
 
 /**
@@ -188,7 +189,7 @@
     {
         if (values == null)
         {
-            values = new ArrayList<DatabasePreferenceValue>();
+            values = (List<DatabasePreferenceValue>)JPAUtils.createList();
         }
         if (valuesCollection == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/PortletPreferencesProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/PortletPreferencesProviderImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/PortletPreferencesProviderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/PortletPreferencesProviderImpl.java Sun Jan 11 16:14:38 2009
@@ -23,8 +23,6 @@
 import java.util.Map;
 
 import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
 import javax.persistence.Query;
 
 import javax.portlet.PortletRequest;
@@ -169,7 +167,7 @@
      * 
      * @return entity manager.
      */
-    protected EntityManager getEntityManager()
+    public EntityManager getEntityManager()
     {
         return registryManager.getEntityManager();
     }

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/OpenJPAPortletRegistryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/OpenJPAPortletRegistryImpl.java?rev=733549&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/OpenJPAPortletRegistryImpl.java (added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/OpenJPAPortletRegistryImpl.java Sun Jan 11 16:14:38 2009
@@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.components.portletregistry.jpa;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.EntityManager;
+
+import org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider;
+import org.apache.jetspeed.components.rdbms.jpa.OpenJPADistributedCacheListener;
+import org.apache.jetspeed.components.rdbms.jpa.OpenJPARemoteCommitListener;
+import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.om.portlet.jpa.PortletApplicationDefinitionImpl;
+import org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl;
+import org.apache.openjpa.conf.OpenJPAConfiguration;
+import org.apache.openjpa.datacache.DataCache;
+import org.apache.openjpa.datacache.DataCacheManager;
+import org.apache.openjpa.event.RemoteCommitEventManager;
+import org.apache.openjpa.event.RemoteCommitProvider;
+import org.apache.openjpa.event.SingleJVMRemoteCommitProvider;
+import org.apache.openjpa.persistence.EntityManagerImpl;
+
+/**
+ * OpenJPAPortletRegistryImpl
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class OpenJPAPortletRegistryImpl extends PortletRegistryImpl implements OpenJPADistributedCacheListener
+{
+    // Members
+    
+    private RemoteCommitEventManager openJPAEventManager;
+    private DataCache openJPASystemDataCache;
+    private boolean distributed;
+    private OpenJPARemoteCommitListener listener;
+
+    // Constructors
+
+    /**
+     * Construct with registry manager and preferences service.
+     * 
+     * @param registryManager registry manager.
+     * @param preferenceService preferences service.
+     */
+    public OpenJPAPortletRegistryImpl(RegistryManager registryManager, PortletPreferencesProvider preferenceService)
+    {
+        super(registryManager, preferenceService);
+    }
+    
+    // Lifecycle
+    
+    /**
+     * Initialize by registering an event listener.
+     */
+    public void initialize()
+    {
+        // get OpenJPA entity manager and event manager
+        EntityManager entityManager = getEntityManager();
+        EntityManagerImpl openJPAEntityManager = (EntityManagerImpl)entityManager.getDelegate();
+        if (openJPAEntityManager != null)
+        {
+            // check OpenJPA configuration for distributed operation
+            OpenJPAConfiguration configuration = openJPAEntityManager.getConfiguration();
+            openJPAEventManager = configuration.getRemoteCommitEventManager();
+            if (openJPAEventManager.areRemoteEventsEnabled())
+            {
+                RemoteCommitProvider provider = openJPAEventManager.getRemoteCommitProvider();
+                distributed = ((provider != null) && !(provider instanceof SingleJVMRemoteCommitProvider));
+            }
+            // access system wide data cache
+            DataCacheManager openJPADataCacheManager = configuration.getDataCacheManagerInstance();
+            openJPASystemDataCache = openJPADataCacheManager.getSystemDataCache();
+        }
+        entityManager.close();
+
+        // register remote listener for distributed operation
+        if ((openJPAEventManager != null) && (openJPASystemDataCache != null) && distributed)
+        {
+            // create listener for page manager entities
+            Set<Class> entityClasses = new HashSet<Class>();
+            entityClasses.add(PortletApplicationDefinitionImpl.class);
+            entityClasses.add(PortletDefinitionImpl.class);
+            listener = new OpenJPARemoteCommitListener(openJPASystemDataCache, entityClasses, this);
+            // add as an internal listener to receive events
+            // before underlying caches so that oids can be
+            // looked up in the internal system caches
+            openJPAEventManager.addInternalListener(listener);
+        }
+    }
+
+    /**
+     * Terminate by unregistering the event listener.
+     */
+    public void terminate()
+    {
+        // unregister remote listener for distributed operation
+        if ((openJPAEventManager != null) && distributed && (listener != null))
+        {
+            openJPAEventManager.removeListener(listener);
+        }
+    }    
+
+    // Implementation
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.rdbms.jpa.OpenJPADistributedCacheListener#notifyUpdatedEntity(java.lang.Object)
+     */
+    public void notifyUpdatedEntity(Object entity)
+    {
+        // notify listeners of updated definitions
+        if (entity instanceof PortletApplication)
+        {
+            notifyApplicationUpdated((PortletApplication)entity);
+        }
+        else if (entity instanceof PortletDefinition)
+        {
+            notifyPortletUpdated((PortletDefinition)entity);
+        }
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java Sun Jan 11 16:14:38 2009
@@ -22,8 +22,6 @@
 
 import javax.persistence.EntityManager;
 import javax.persistence.NoResultException;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
 import javax.persistence.Query;
 
 import org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider;
@@ -78,7 +76,7 @@
      * 
      * @return entity manager.
      */
-    protected EntityManager getEntityManager()
+    public EntityManager getEntityManager()
     {
         return registryManager.getEntityManager();
     }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomPortletModeImpl.java Sun Jan 11 16:14:38 2009
@@ -16,7 +16,6 @@
 */
 package org.apache.jetspeed.om.portlet.jpa;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Locale;
 
@@ -38,6 +37,7 @@
 
 import javax.portlet.PortletMode;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.CustomPortletMode;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.util.JetspeedLocale;
@@ -166,7 +166,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/CustomWindowStateImpl.java Sun Jan 11 16:14:38 2009
@@ -38,6 +38,7 @@
 
 import javax.portlet.WindowState;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.CustomWindowState;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.util.JetspeedLocale;
@@ -165,7 +166,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/InitParamImpl.java Sun Jan 11 16:14:38 2009
@@ -38,6 +38,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.InitParam;
 import org.apache.jetspeed.util.HashCodeBuilder;
@@ -166,7 +167,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java Sun Jan 11 16:14:38 2009
@@ -39,6 +39,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.CustomPortletMode;
 import org.apache.jetspeed.om.portlet.CustomWindowState;
 import org.apache.jetspeed.om.portlet.Description;
@@ -203,7 +204,6 @@
         applicationType = PortletApplication.WEBAPP;
         checksum = "0";
         checksumLong = -1;
-        services = new ArrayList<JetspeedServiceReference>();
     }
 
     /**
@@ -306,7 +306,7 @@
     {
         if (metadataFields == null)
         {
-            metadataFields = new ArrayList<LocalizedField>();
+            metadataFields = (Collection<LocalizedField>)JPAUtils.createCollection();
         }
         if (metadataFieldsCollection == null)
         {
@@ -321,7 +321,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {
@@ -348,7 +348,7 @@
     {
         if (displayNames == null)
         {
-            displayNames = new ArrayList<DisplayName>();
+            displayNames = (List<DisplayName>)JPAUtils.createList();
         }
         if (displayNamesList == null)
         {
@@ -375,7 +375,7 @@
     {
         if (roles == null)
         {
-            roles = new ArrayList<SecurityRole>();
+            roles = (List<SecurityRole>)JPAUtils.createList();
         }
         if (rolesList == null)
         {
@@ -403,7 +403,7 @@
     {
         if (portlets == null)
         {
-            portlets = new ArrayList<PortletDefinition>();
+            portlets = (List<PortletDefinition>)JPAUtils.createList();
         }
         if (portletsList == null)
         {
@@ -429,7 +429,7 @@
     {
         if (customPortletModes == null)
         {
-            customPortletModes = new ArrayList<CustomPortletMode>();
+            customPortletModes = (List<CustomPortletMode>)JPAUtils.createList();
         }
         if (customPortletModesList == null)
         {
@@ -460,7 +460,7 @@
     {
         if (customWindowStates == null)
         {
-            customWindowStates = new ArrayList<CustomWindowState>();
+            customWindowStates = (List<CustomWindowState>)JPAUtils.createList();
         }
         if (customWindowStatesList == null)
         {
@@ -491,7 +491,7 @@
     {
         if (userAttributes == null)
         {
-            userAttributes = new ArrayList<UserAttribute>();
+            userAttributes = (List<UserAttribute>)JPAUtils.createList();
         }
         if (userAttributesList == null)
         {
@@ -516,7 +516,7 @@
     {
         if (userAttributeRefs == null)
         {
-            userAttributeRefs = new ArrayList<UserAttributeRef>();
+            userAttributeRefs = (List<UserAttributeRef>)JPAUtils.createList();
         }
         if (userAttributeRefsList == null)
         {
@@ -541,7 +541,7 @@
     {
         if (services == null)
         {
-            this.services = new ArrayList<JetspeedServiceReference>();
+            this.services = (List<JetspeedServiceReference>)JPAUtils.createList();
         }
         if (servicesList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java Sun Jan 11 16:14:38 2009
@@ -43,6 +43,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.DisplayName;
 import org.apache.jetspeed.om.portlet.GenericMetadata;
@@ -239,7 +240,7 @@
     {
         if ( languages == null )
         {
-            languages = new ArrayList<Language>();
+            languages = (List<Language>)JPAUtils.createList();
         }
         if ( languagesList == null )
         {
@@ -281,7 +282,7 @@
     {
         if (metadataFields == null)
         {
-            metadataFields = new ArrayList<LocalizedField>();
+            metadataFields = (Collection<LocalizedField>)JPAUtils.createCollection();
         }
         if (metadataFieldsCollection == null)
         {
@@ -364,7 +365,7 @@
     {
         if (securityRoleRefs == null)
         {
-            securityRoleRefs = new ArrayList<SecurityRoleRef>();
+            securityRoleRefs = (List<SecurityRoleRef>)JPAUtils.createList();
         }
         if (securityRoleRefsList == null)
         {
@@ -389,7 +390,7 @@
     {
         if (supports == null)
         {
-            supports = new ArrayList<Supports>();
+            supports = (List<Supports>)JPAUtils.createList();
         }
         if (supportsList == null)
         {
@@ -429,7 +430,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {
@@ -457,7 +458,7 @@
     {
         if (displayNames == null)
         {
-            displayNames = new ArrayList<DisplayName>();
+            displayNames = (List<DisplayName>)JPAUtils.createList();
         }
         if (displayNamesList == null)
         {
@@ -484,7 +485,7 @@
     {
         if (initParams == null)
         {
-            initParams = new ArrayList<InitParam>();
+            initParams = (List<InitParam>)JPAUtils.createList();
         }
         if (initParamsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleImpl.java Sun Jan 11 16:14:38 2009
@@ -37,6 +37,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.SecurityRole;
 import org.apache.jetspeed.util.JetspeedLocale;
@@ -117,7 +118,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SecurityRoleRefImpl.java Sun Jan 11 16:14:38 2009
@@ -37,6 +37,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.SecurityRoleRef;
 import org.apache.jetspeed.util.HashCodeBuilder;
@@ -146,7 +147,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SupportsImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SupportsImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SupportsImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/SupportsImpl.java Sun Jan 11 16:14:38 2009
@@ -37,8 +37,8 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
-import org.apache.jetspeed.util.HashCodeBuilder;
 import org.apache.jetspeed.om.portlet.Supports;
+import org.apache.jetspeed.util.HashCodeBuilder;
 
 /**
  * @version $Id: SupportsImpl.java 708230 2008-10-27 16:22:32Z ate $

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeImpl.java Sun Jan 11 16:14:38 2009
@@ -36,6 +36,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.UserAttribute;
 import org.apache.jetspeed.util.JetspeedLocale;
@@ -117,7 +118,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/UserAttributeRefImpl.java Sun Jan 11 16:14:38 2009
@@ -37,6 +37,7 @@
 import javax.persistence.Transient;
 import javax.persistence.Version;
 
+import org.apache.jetspeed.components.rdbms.jpa.JPAUtils;
 import org.apache.jetspeed.om.portlet.Description;
 import org.apache.jetspeed.om.portlet.UserAttribute;
 import org.apache.jetspeed.om.portlet.UserAttributeRef;
@@ -156,7 +157,7 @@
     {
         if (descriptions == null)
         {
-            descriptions = new ArrayList<Description>();
+            descriptions = (List<Description>)JPAUtils.createList();
         }
         if (descriptionsList == null)
         {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/jpa-registry.xml Sun Jan 11 16:14:38 2009
@@ -51,6 +51,40 @@
     <!-- Spring Transaction Annotations -->
     <tx:annotation-driven/>
 
+    <!-- JPA/OpenJPA Registry Components -->
+    <bean id="portletFactory" class="org.apache.jetspeed.factory.JetspeedPortletFactory"/>
+    <bean id="registryManager" class="org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerImpl"/>
+    <bean id="portletPreferencesProvider" class="org.apache.jetspeed.components.portletpreferences.jpa.PortletPreferencesProviderImpl" init-method="init" destroy-method="destroy">
+        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
+        <constructor-arg index="1"><ref bean="portletFactory"/></constructor-arg>
+        <property name="useEntityPreferences"><value>true</value></property>
+    </bean>
+    <bean id="portletEntityAccess" class="org.apache.jetspeed.components.portletentity.jpa.PortletEntityAccessComponentImpl">
+        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
+        <constructor-arg index="1"><ref bean="portletRegistry"/></constructor-arg>
+        <constructor-arg index="2"><value>false</value></constructor-arg>
+    </bean>
+
+    <!-- JPA Registry Component Injection, (consider component/object infusion to eliminate these) -->
+    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
+        <property name="className" value="org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl"/>
+        <property name="methodName" value="setPortletFactory"/>
+        <property name="typeName" value="org.apache.jetspeed.factory.PortletFactory"/>
+        <property name="value"><ref bean="portletFactory"/></property>
+    </bean>
+    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
+        <property name="className" value="org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl"/>
+        <property name="methodName" value="setPortletPreferencesProvider"/>
+        <property name="typeName" value="org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider"/>
+        <property name="value"><ref bean="portletPreferencesProvider"/></property>
+    </bean>
+    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
+        <property name="className" value="org.apache.jetspeed.components.portletentity.jpa.PortletEntityImpl"/>
+        <property name="methodName" value="setPortletRegistry"/>
+        <property name="typeName" value="org.apache.jetspeed.components.portletregistry.PortletRegistry"/>
+        <property name="value"><ref bean="portletRegistry"/></property>
+    </bean>
+
     <!-- JPA Registry Manager Context -->
     <bean id="registryManagerContext" class="org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerContext" scope="prototype" init-method="initialize" destroy-method="terminate">
         <property name="registryManager"><ref bean="registryManager"/></property>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml?rev=733549&r1=733548&r2=733549&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml (original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry.xml Sun Jan 11 16:14:38 2009
@@ -26,40 +26,9 @@
     <import resource="openjpa-registry-base.xml"/>
 
     <!-- JPA/OpenJPA Registry Components -->
-    <bean id="portletFactory" class="org.apache.jetspeed.factory.JetspeedPortletFactory"/>
-    <bean id="registryManager" class="org.apache.jetspeed.components.portletregistry.jpa.RegistryManagerImpl"/>
-    <bean id="portletPreferencesProvider" class="org.apache.jetspeed.components.portletpreferences.jpa.PortletPreferencesProviderImpl" init-method="init" destroy-method="destroy">
-        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
-        <constructor-arg index="1"><ref bean="portletFactory"/></constructor-arg>
-        <property name="useEntityPreferences"><value>true</value></property>
-    </bean>
-    <bean id="portletRegistry" class="org.apache.jetspeed.components.portletregistry.jpa.PortletRegistryImpl">
+    <bean id="portletRegistry" class="org.apache.jetspeed.components.portletregistry.jpa.OpenJPAPortletRegistryImpl" init-method="initialize" destroy-method="terminate">
         <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
         <constructor-arg index="1"><ref bean="portletPreferencesProvider"/></constructor-arg>
     </bean>
-    <bean id="portletEntityAccess" class="org.apache.jetspeed.components.portletentity.jpa.PortletEntityAccessComponentImpl">
-        <constructor-arg index="0"><ref bean="registryManager"/></constructor-arg>
-        <constructor-arg index="1"><ref bean="portletRegistry"/></constructor-arg>
-        <constructor-arg index="2"><value>false</value></constructor-arg>
-    </bean>
 
-    <!-- JPA/OpenJPA Registry Component Injection, (consider component/object infusion to eliminate these) -->
-    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
-        <property name="className" value="org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl"/>
-        <property name="methodName" value="setPortletFactory"/>
-        <property name="typeName" value="org.apache.jetspeed.factory.PortletFactory"/>
-        <property name="value"><ref bean="portletFactory"/></property>
-    </bean>
-    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
-        <property name="className" value="org.apache.jetspeed.om.portlet.jpa.PortletDefinitionImpl"/>
-        <property name="methodName" value="setPortletPreferencesProvider"/>
-        <property name="typeName" value="org.apache.jetspeed.components.portletpreferences.PortletPreferencesProvider"/>
-        <property name="value"><ref bean="portletPreferencesProvider"/></property>
-    </bean>
-    <bean class="org.apache.jetspeed.components.LifecycleAwareStaticClassInitializer">
-        <property name="className" value="org.apache.jetspeed.components.portletentity.jpa.PortletEntityImpl"/>
-        <property name="methodName" value="setPortletRegistry"/>
-        <property name="typeName" value="org.apache.jetspeed.components.portletregistry.PortletRegistry"/>
-        <property name="value"><ref bean="portletRegistry"/></property>
-    </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