portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r784908 - in /portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE: components/prefs/src/java/org/apache/jetspeed/prefs/impl/ jetspeed-api/src/java/org/apache/jetspeed/prefs/ src/webapp/WEB-INF/assembly/
Date Mon, 15 Jun 2009 18:41:28 GMT
Author: rwatler
Date: Mon Jun 15 18:41:28 2009
New Revision: 784908

URL: http://svn.apache.org/viewvc?rev=784908&view=rev
Log:
JS2-1033: deadlock during PAM initialization

Modified:
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
    portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/src/webapp/WEB-INF/assembly/prefs.xml

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java?rev=784908&r1=784907&r2=784908&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
(original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/components/prefs/src/java/org/apache/jetspeed/prefs/impl/PersistenceBrokerPreferencesProvider.java
Mon Jun 15 18:41:28 2009
@@ -562,17 +562,42 @@
         return new PropertyImpl(node.getNodeId(), name, value);
     }
 
-    public void init() throws Exception
+    public void preload() throws Exception
     {
-        super.init();
+        // ensure base root preference nodes exist
+        Node systemRoot = null;
+        if (!nodeExists("/", PreferencesImpl.SYSTEM_NODE_TYPE))
+        {
+            systemRoot = createNode(null, "", PreferencesImpl.SYSTEM_NODE_TYPE, "/");
+        }
+        else
+        {
+            systemRoot = getNode("/", PreferencesImpl.SYSTEM_NODE_TYPE);
+        }
+        if (!nodeExists("/" + MutablePortletApplication.PREFS_ROOT, PreferencesImpl.SYSTEM_NODE_TYPE))
+        {
+            createNode(systemRoot, MutablePortletApplication.PREFS_ROOT, PreferencesImpl.SYSTEM_NODE_TYPE,
"/" + MutablePortletApplication.PREFS_ROOT);
+        }
+        if (!nodeExists("/" + MutablePortletEntity.PORTLET_ENTITY_ROOT, PreferencesImpl.SYSTEM_NODE_TYPE))
+        {
+            createNode(systemRoot, MutablePortletEntity.PORTLET_ENTITY_ROOT, PreferencesImpl.SYSTEM_NODE_TYPE,
"/" + MutablePortletEntity.PORTLET_ENTITY_ROOT);
+        }
+        if (!nodeExists("/", PreferencesImpl.USER_NODE_TYPE))
+        {
+            createNode(null, "", PreferencesImpl.USER_NODE_TYPE, "/");
+        }
+        // preload portlet application
         Iterator apps = this.preloadedApplications.iterator();
         while (apps.hasNext())
         {
             String appName = (String)apps.next();
             preloadApplicationPreferences(appName);
         }
+        // preload portlet entities
         if (preloadEntities)
+        {
             preloadAllEntities();
+        }
     }
     
     public void preloadApplicationPreferences(String portletApplicationName) throws NodeDoesNotExistException

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java?rev=784908&r1=784907&r2=784908&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
(original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/jetspeed-api/src/java/org/apache/jetspeed/prefs/PreferencesProvider.java
Mon Jun 15 18:41:28 2009
@@ -115,11 +115,11 @@
     Collection lookupPreference(String nodeName, String propertyName, String propertyValue);
 
     /**
-     * Initializes the preferences node
+     * Initializes the preferences node by executing configured preloads.
      * 
      * @throws Exception
      */
-    void init() throws Exception;
+    void preload() throws Exception;
 
     /**
      * Preload preferences for specified portlet application.

Modified: portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/src/webapp/WEB-INF/assembly/prefs.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/src/webapp/WEB-INF/assembly/prefs.xml?rev=784908&r1=784907&r2=784908&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/src/webapp/WEB-INF/assembly/prefs.xml
(original)
+++ portals/jetspeed-2/portal/branches/JETSPEED-2.1.3-POSTRELEASE/src/webapp/WEB-INF/assembly/prefs.xml
Mon Jun 15 18:41:28 2009
@@ -46,6 +46,7 @@
         </property>
         <property name="transactionAttributes">
             <props>
+                <prop key="preload">PROPAGATION_REQUIRED</prop>
                 <prop key="createNode*">PROPAGATION_REQUIRED</prop>
                 <prop key="storeNode*">PROPAGATION_REQUIRED</prop>
                 <prop key="removeNode*">PROPAGATION_REQUIRED</prop>
@@ -54,9 +55,15 @@
         </property>
     </bean>
 
+   <!-- preload preferences provider within transaction -->
+   <bean id="preloadPrefsProvider" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref bean="prefsProvider"/></property>
+        <property name="targetMethod"><value>preload</value></property>
+    </bean>    
+
     <!-- PreferencesFactory implementation -->
    <bean id="java.util.prefs.PreferencesFactory" class="org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl"
-         name="prefsFactory" init-method="init" destroy-method="destroy">
+         name="prefsFactory" depends-on="preloadPrefsProvider" init-method="init" destroy-method="destroy">
         <!-- dummy constructor argument to distinguish it from the default constructor
invoked by the Java Preferences itself --> 
         <constructor-arg><value>1</value></constructor-arg>    
         <property name="prefsProvider">
@@ -64,4 +71,4 @@
         </property>
     </bean>
 
-</beans>
\ No newline at end of file
+</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