Author: taylor
Date: Wed Feb 14 17:14:08 2007
New Revision: 507766
URL: http://svn.apache.org/viewvc?view=rev&rev=507766
Log:
https://issues.apache.org/jira/browse/JS2-654
this caching fix should clean up the memory wasted in the registry reported by
Ethan Adams
additionally, i have started looking into using proxies to improve the
distributed notifications of registry modifications
this work is still ongoing
Added:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/MutablePortletApplicationProxy.java
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletApplicationProxy.java
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletDefinitionCompositeProxy.java
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryApplicationCache.java
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryPortletCache.java
portals/jetspeed-2/trunk/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCacheEventListener.java
Modified:
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityAccessControllerImpl.java
portals/jetspeed-2/trunk/components/registry/etc/assembly/registry-test.xml
portals/jetspeed-2/trunk/components/registry/maven.xml
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
portals/jetspeed-2/trunk/etc/db-ojb/ehcache.xml
portals/jetspeed-2/trunk/etc/registration/assembly/registry.xml
portals/jetspeed-2/trunk/etc/registration/registration.properties
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCache.java
portals/jetspeed-2/trunk/maven.xml
portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml
portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/registry.xml
Modified:
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityAccessControllerImpl.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityAccessControllerImpl.java?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityAccessControllerImpl.java
(original)
+++
portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/security/impl/SecurityAccessControllerImpl.java
Wed Feb 14 17:14:08 2007
@@ -51,6 +51,8 @@
public boolean checkPortletAccess(PortletDefinitionComposite portlet, int
mask)
{
+ if (portlet == null)
+ return false;
if (securityMode == SecurityAccessController.CONSTRAINTS)
{
String constraintRef = portlet.getJetspeedSecurityConstraint();
Modified:
portals/jetspeed-2/trunk/components/registry/etc/assembly/registry-test.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/etc/assembly/registry-test.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/etc/assembly/registry-test.xml
(original)
+++ portals/jetspeed-2/trunk/components/registry/etc/assembly/registry-test.xml
Wed Feb 14 17:14:08 2007
@@ -28,7 +28,13 @@
</constructor-arg>
<constructor-arg index="1">
<ref bean="portletFactory" />
- </constructor-arg>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <ref bean="portletApplicationOidCache" />
+ </constructor-arg>
+ <constructor-arg index="3">
+ <ref bean="portletDefinitionOidCache" />
+ </constructor-arg>
</bean>
<bean id="org.apache.jetspeed.components.portletregistry.PortletRegistry"
name="portletRegistry" parent="baseTransactionProxy">
Modified: portals/jetspeed-2/trunk/components/registry/maven.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/maven.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/components/registry/maven.xml (original)
+++ portals/jetspeed-2/trunk/components/registry/maven.xml Wed Feb 14 17:14:08
2007
@@ -16,6 +16,6 @@
-->
<project default="java:jar" xmlns:j="jelly:core" xmlns:define="jelly:define"
xmlns:maven="jelly:maven">
- <property name='testcase'
value='org.apache.jetspeed.components.portletregistry.TestRegistryDirectAll' />
+ <property name='testcase'
value='org.apache.jetspeed.components.portletregistry.TestRegistryCache' />
</project>
Modified:
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
(original)
+++
portals/jetspeed-2/trunk/components/registry/src/java/JETSPEED-INF/ojb/registry_repository.xml
Wed Feb 14 17:14:08 2007
@@ -104,6 +104,7 @@
class="org.apache.jetspeed.om.common.portlet.MutablePortletApplication"
>
+ <object-cache
class="org.apache.jetspeed.components.portletregistry.RegistryApplicationCache"/>
<extent-class
class-ref="org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl"
/>
</class-descriptor>
@@ -112,6 +113,7 @@
class="org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl"
table="PORTLET_APPLICATION"
>
+ <object-cache
class="org.apache.jetspeed.components.portletregistry.RegistryApplicationCache"/>
<field-descriptor
name="id"
@@ -321,7 +323,7 @@
table="PORTLET_DEFINITION"
>
-
+ <object-cache
class="org.apache.jetspeed.components.portletregistry.RegistryPortletCache"/>
<field-descriptor
name="id"
Modified:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
(original)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletentity/PortletEntityImpl.java
Wed Feb 14 17:14:08 2007
@@ -75,8 +75,6 @@
private static final Log log = LogFactory.getLog(PortletEntityImpl.class);
- protected List originalPreferences;
-
protected Map perPrincipalPrefs = new HashMap();
protected Map originalValues;
Added:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/MutablePortletApplicationProxy.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/MutablePortletApplicationProxy.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/MutablePortletApplicationProxy.java
(added)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/MutablePortletApplicationProxy.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,108 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
+
+public class MutablePortletApplicationProxy implements InvocationHandler,
PortletApplicationProxy
+{
+ public boolean equals(Object obj)
+ {
+ return super.equals(obj);
+ // if (obj instanceof MutablePortletApplicationProxy)
+// {
+// MutablePortletApplicationProxy other =
(MutablePortletApplicationProxy)obj;
+// if (this.getRealApplication().g)
+// }
+ }
+
+ private MutablePortletApplication app = null;
+ private static PortletRegistry registry;
+ private String name;
+
+ public MutablePortletApplicationProxy(MutablePortletApplication app)
+ {
+ this.app = app;
+ this.name = app.getName();
+ }
+
+ public static void setRegistry(PortletRegistry r)
+ {
+ registry = r;
+ }
+
+ public static MutablePortletApplication createProxy(
+ MutablePortletApplication app)
+ {
+ Class[] proxyInterfaces = new Class[]
+ { MutablePortletApplication.class, PortletApplicationProxy.class};
+ MutablePortletApplication proxy = (MutablePortletApplication) Proxy
+ .newProxyInstance(MutablePortletApplication.class
+ .getClassLoader(), proxyInterfaces,
+ new MutablePortletApplicationProxy(app));
+ return proxy;
+ }
+
+ protected void invalidate()
+ {
+ this.app = null;
+ }
+
+ public void setRealApplication(MutablePortletApplication app)
+ {
+ this.app = app;
+ }
+
+ public MutablePortletApplication getRealApplication()
+ {
+ return app;
+ }
+
+ public Object invoke(Object proxy, Method m, Object[] args)
+ throws Throwable
+ {
+ try
+ {
+ if (m.getName().equals("getRealApplication"))
+ {
+ return getRealApplication();
+ }
+ else if (m.getName().equals("setRealApplication"))
+ {
+ setRealApplication((MutablePortletApplication)args[0]);
+ return null;
+ }
+ else
+ {
+ if (app == null)
+ {
+ app = registry.getPortletApplication(name);
+ }
+ return m.invoke(app, args);
+ }
+ }
+ catch (InvocationTargetException e)
+ {
+ throw e.getTargetException();
+ }
+ }
+
+}
Modified:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
(original)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PersistenceBrokerPortletRegistry.java
Wed Feb 14 17:14:08 2007
@@ -16,11 +16,15 @@
package org.apache.jetspeed.components.portletregistry;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
+import java.util.Map;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
+import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.JetspeedCacheEventListener;
import org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport;
import org.apache.jetspeed.factory.PortletFactory;
import org.apache.jetspeed.om.common.MutableLanguage;
@@ -50,29 +54,42 @@
* @version $Id$
*
*/
-public class PersistenceBrokerPortletRegistry extends
InitablePersistenceBrokerDaoSupport implements PortletRegistry
+public class PersistenceBrokerPortletRegistry
+ extends InitablePersistenceBrokerDaoSupport
+ implements PortletRegistry, JetspeedCacheEventListener
{
-
/**
* The separator used to create a unique portlet name as
* {portletApplication}::{portlet}
*/
static final String PORTLET_UNIQUE_NAME_SEPARATOR = "::";
+ private JetspeedCache applicationOidCache = null;
+ private JetspeedCache portletOidCache = null;
+ private Map nameCache = new HashMap();
+
// for testing purposes only: no need for the portletFactory then
public PersistenceBrokerPortletRegistry(String repositoryPath)
{
- this(repositoryPath,null);
+ this(repositoryPath, null, null, null);
}
/**
*
*/
- public PersistenceBrokerPortletRegistry(String repositoryPath,
PortletFactory portletFactory)
+ public PersistenceBrokerPortletRegistry(String repositoryPath,
PortletFactory portletFactory,
+ JetspeedCache applicationOidCache, JetspeedCache portletOidCache)
{
super(repositoryPath);
PortletDefinitionImpl.setPortletRegistry(this);
PortletDefinitionImpl.setPortletFactory(portletFactory);
+ this.applicationOidCache = applicationOidCache;
+ this.portletOidCache = portletOidCache;
+ MutablePortletApplicationProxy.setRegistry(this);
+ RegistryApplicationCache.cacheInit(this, applicationOidCache);
+ RegistryPortletCache.cacheInit(this, applicationOidCache);
+ this.applicationOidCache.addEventListener(this);
+ this.portletOidCache.addEventListener(this);
}
public Language createLanguage( Locale locale, String title, String
shortTitle, String description,
@@ -92,7 +109,7 @@
throw new RegistryException("Unable to create language object.");
}
}
-
+
public Collection getAllPortletDefinitions()
{
Criteria c = new Criteria();
@@ -112,7 +129,7 @@
return app;
}
- public MutablePortletApplication getPortletApplication( String name )
+ public MutablePortletApplication getPortletApplication(String name)
{
Criteria c = new Criteria();
c.addEqualTo("name", name);
@@ -127,7 +144,7 @@
Criteria c = new Criteria();
c.addEqualTo("applicationIdentifier", identifier);
MutablePortletApplication app = (MutablePortletApplication)
getPersistenceBrokerTemplate().getObjectByQuery(
- QueryFactory.newQuery(PortletApplicationDefinitionImpl.class,
c));
+ QueryFactory.newQuery(PortletApplicationDefinitionImpl.class, c));
postLoad(app);
return app;
}
@@ -304,9 +321,31 @@
c.addEqualTo("id", new Long(id.toString()));
PortletDefinitionComposite portlet = (PortletDefinitionComposite)
getPersistenceBrokerTemplate().getObjectByQuery(
QueryFactory.newQuery(PortletDefinitionImpl.class, c));
+
postLoad(portlet);
return portlet;
}
+ public void notifyElementRemoved(JetspeedCache cache, Object o)
+ {
+ System.out.println("--- Registry: notification element is a " + o);
+ // update nameCache
+ }
+
+ protected MutablePortletApplication
getProxiedObject(MutablePortletApplication app)
+ {
+ PortletApplicationProxy cached =
(PortletApplicationProxy)nameCache.get(app.getName());
+ if (cached != null)
+ {
+ cached.setRealApplication(app);
+ return (MutablePortletApplication)cached;
+ }
+ else
+ {
+ MutablePortletApplication proxy =
MutablePortletApplicationProxy.createProxy(app);
+ nameCache.put(app.getName(), proxy);
+ return (MutablePortletApplication)cached;
+ }
+ }
}
Added:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletApplicationProxy.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletApplicationProxy.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletApplicationProxy.java
(added)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletApplicationProxy.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,23 @@
+/* Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
+
+public interface PortletApplicationProxy
+{
+ void setRealApplication(MutablePortletApplication app);
+ MutablePortletApplication getRealApplication();
+}
Added:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletDefinitionCompositeProxy.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletDefinitionCompositeProxy.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletDefinitionCompositeProxy.java
(added)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/PortletDefinitionCompositeProxy.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+
+public class PortletDefinitionCompositeProxy implements InvocationHandler
+{
+ private PortletDefinitionComposite def = null;
+ private static PortletRegistry registry;
+ private String name;
+
+ public PortletDefinitionCompositeProxy(PortletDefinitionComposite def)
+ {
+ this.def = def;
+ this.name = def.getUniqueName();
+ }
+
+ public static void setRegistry(PortletRegistry r)
+ {
+ registry = r;
+ }
+
+ public static PortletDefinitionComposite createProxy(
+ PortletDefinitionComposite def)
+ {
+ Class[] proxyInterfaces = new Class[]
+ { PortletDefinitionComposite.class};
+ PortletDefinitionComposite proxy = (PortletDefinitionComposite) Proxy
+ .newProxyInstance(PortletDefinitionComposite.class
+ .getClassLoader(), proxyInterfaces,
+ new PortletDefinitionCompositeProxy(def));
+ return proxy;
+ }
+
+ protected void invalidate()
+ {
+ this.def = null;
+ }
+
+ protected void setRealDefinition(PortletDefinitionComposite d)
+ {
+ this.def = d;
+ }
+
+ protected PortletDefinitionComposite getRealApplication()
+ {
+ return def;
+ }
+
+ public Object invoke(Object proxy, Method m, Object[] args)
+ throws Throwable
+ {
+ try
+ {
+ if (def == null)
+ {
+ def = registry.getPortletDefinitionByUniqueName(name);
+ }
+ return m.invoke(def, args);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw e.getTargetException();
+ }
+ }
+
+}
Added:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryApplicationCache.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryApplicationCache.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryApplicationCache.java
(added)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryApplicationCache.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+import java.util.Properties;
+
+import org.apache.jetspeed.cache.CacheElement;
+import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.impl.EhCacheElementImpl;
+import org.apache.ojb.broker.Identity;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.cache.ObjectCache;
+
+/**
+ * OJB cache
+ *
+ * @author dtaylor
+ *
+ */
+public class RegistryApplicationCache implements ObjectCache
+{
+ private static JetspeedCache oidCache;
+ private static PortletRegistry registry;
+
+ public RegistryApplicationCache(PersistenceBroker broker, Properties props)
+ {
+ }
+
+ public synchronized static void cacheInit(PortletRegistry r, JetspeedCache
o)
+ {
+ registry = r;
+ oidCache = o;
+ }
+
+ public Object lookup(Identity oid)
+ {
+ return cacheLookup(oid);
+ }
+ public synchronized static Object cacheLookup(Identity oid)
+ {
+ CacheElement element = oidCache.get(oid);
+ if (element != null)
+ {
+ return element.getContent();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.apache.ojb.broker.cache.ObjectCache#cache(org.apache.ojb.broker.Identity,
java.lang.Object)
+ */
+ public void cache(Identity oid, Object obj)
+ {
+ cacheAdd(oid, obj);
+ }
+ public synchronized static void cacheAdd(Identity oid, Object obj)
+ {
+ CacheElement entry = (CacheElement)oidCache.get(oid);
+ if (entry != null)
+ {
+ oidCache.remove(oid);
+ entry = new EhCacheElementImpl(oid, obj);
+ oidCache.put(entry);
+ }
+ else
+ {
+ //MutablePortletApplication proxy =
MutablePortletApplicationProxy.createProxy((MutablePortletApplication)obj);
+ entry = new EhCacheElementImpl(oid, obj);
+ oidCache.put(entry);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.ojb.broker.cache.ObjectCache#clear()
+ */
+ public void clear()
+ {
+ cacheClear();
+ }
+ public synchronized static void cacheClear()
+ {
+ oidCache.clear();
+ }
+
+
+ /* (non-Javadoc)
+ * @see
org.apache.ojb.broker.cache.ObjectCache#remove(org.apache.ojb.broker.Identity)
+ */
+ public void remove(Identity oid)
+ {
+ cacheRemove(oid);
+ }
+ /**
+ * cacheRemove
+ *
+ * Remove identified object from object and node caches.
+ *
+ * @param oid object identity
+ */
+ public synchronized static void cacheRemove(Identity oid)
+ {
+ oidCache.remove(oid);
+ }
+
+}
Added:
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryPortletCache.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryPortletCache.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryPortletCache.java
(added)
+++
portals/jetspeed-2/trunk/components/registry/src/java/org/apache/jetspeed/components/portletregistry/RegistryPortletCache.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+import java.util.Properties;
+
+import org.apache.jetspeed.cache.CacheElement;
+import org.apache.jetspeed.cache.JetspeedCache;
+import org.apache.jetspeed.cache.impl.EhCacheElementImpl;
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+import org.apache.ojb.broker.Identity;
+import org.apache.ojb.broker.PersistenceBroker;
+import org.apache.ojb.broker.cache.ObjectCache;
+
+/**
+ * OJB cache
+ *
+ * @author dtaylor
+ *
+ */
+public class RegistryPortletCache implements ObjectCache
+{
+ private static JetspeedCache oidCache;
+ private static PortletRegistry registry;
+
+ public RegistryPortletCache(PersistenceBroker broker, Properties props)
+ {
+ }
+
+ public synchronized static void cacheInit(PortletRegistry r, JetspeedCache
o)
+ {
+ registry = r;
+ oidCache = o;
+ }
+
+ public Object lookup(Identity oid)
+ {
+ return cacheLookup(oid);
+ }
+ public synchronized static Object cacheLookup(Identity oid)
+ {
+ CacheElement element = oidCache.get(oid);
+ if (element != null)
+ {
+ return element.getContent();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
org.apache.ojb.broker.cache.ObjectCache#cache(org.apache.ojb.broker.Identity,
java.lang.Object)
+ */
+ public void cache(Identity oid, Object obj)
+ {
+ cacheAdd(oid, obj);
+ }
+ public synchronized static void cacheAdd(Identity oid, Object obj)
+ {
+ CacheElement entry = (CacheElement)oidCache.get(oid);
+ if (entry != null)
+ {
+ oidCache.remove(oid);
+ entry = new EhCacheElementImpl(oid, obj);
+ oidCache.put(entry);
+ }
+ else
+ {
+ //PortletDefinitionComposite proxy =
PortletDefinitionCompositeProxy.createProxy((PortletDefinitionComposite)obj);
+ entry = new EhCacheElementImpl(oid, entry);
+ oidCache.put(entry);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.ojb.broker.cache.ObjectCache#clear()
+ */
+ public void clear()
+ {
+ cacheClear();
+ }
+ public synchronized static void cacheClear()
+ {
+ oidCache.clear();
+ }
+
+
+ /* (non-Javadoc)
+ * @see
org.apache.ojb.broker.cache.ObjectCache#remove(org.apache.ojb.broker.Identity)
+ */
+ public void remove(Identity oid)
+ {
+ cacheRemove(oid);
+ }
+ /**
+ * cacheRemove
+ *
+ * Remove identified object from object and node caches.
+ *
+ * @param oid object identity
+ */
+ public synchronized static void cacheRemove(Identity oid)
+ {
+ oidCache.remove(oid);
+ }
+
+}
Added:
portals/jetspeed-2/trunk/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
(added)
+++
portals/jetspeed-2/trunk/components/registry/src/test/org/apache/jetspeed/components/portletregistry/TestRegistryCache.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ *
+ * Licensed 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;
+
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Locale;
+
+import javax.portlet.PortletMode;
+
+import org.apache.jetspeed.components.persistence.store.LockFailedException;
+import org.apache.jetspeed.components.util.DatasourceEnabledSpringTestCase;
+import org.apache.jetspeed.om.common.JetspeedServiceReference;
+import org.apache.jetspeed.om.common.UserAttribute;
+import org.apache.jetspeed.om.common.UserAttributeRef;
+import org.apache.jetspeed.om.common.portlet.ContentTypeComposite;
+import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
+import org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite;
+import org.apache.jetspeed.om.common.preference.PreferenceComposite;
+import org.apache.jetspeed.om.impl.JetspeedServiceReferenceImpl;
+import org.apache.jetspeed.om.impl.UserAttributeImpl;
+import org.apache.jetspeed.om.impl.UserAttributeRefImpl;
+import org.apache.jetspeed.om.portlet.impl.ContentTypeImpl;
+import org.apache.jetspeed.om.portlet.impl.PortletApplicationDefinitionImpl;
+import org.apache.jetspeed.om.portlet.impl.PortletDefinitionImpl;
+import org.apache.jetspeed.om.servlet.impl.WebApplicationDefinitionImpl;
+import org.apache.jetspeed.util.JetspeedLocale;
+import org.apache.pluto.om.common.PreferenceSetCtrl;
+import org.apache.pluto.om.portlet.PortletApplicationDefinition;
+
+/**
+ * <p>
+ * TestPortletRegistryDAO
+ * </p>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">Scott T. Weaver</a>
+ * @version $Id: TestPortletRegistryDAO.java 506825 2007-02-13 02:47:07Z
taylor $
+ */
+public class TestRegistryCache extends DatasourceEnabledSpringTestCase
+{
+ protected PortletRegistry portletRegistry;
+
+ /*
+ * @see TestCase#setUp()
+ */
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+ this.portletRegistry = (PortletRegistry)
ctx.getBean("portletRegistry");
+
+ buildTestData();
+
+ }
+
+ // impl not complete
+ public void xtestProxy() throws Exception
+ {
+ MutablePortletApplication app =
portletRegistry.getPortletApplication("PA-001");
+ MutablePortletApplication cached =
MutablePortletApplicationProxy.createProxy(app);
+ if (cached instanceof MutablePortletApplication)
+ System.out.println("ISA Mutable");
+ if (cached instanceof PortletApplicationProxy)
+ System.out.println("ISA Mutable Proxy");
+ PortletApplicationProxy proxy = (PortletApplicationProxy)cached;
+ MutablePortletApplication two = proxy.getRealApplication();
+ proxy.setRealApplication(two);
+ System.out.println("Two is " + two);
+ assertEquals(app, two);
+ }
+
+ public void testCache() throws Exception
+ {
+ assertNotNull(portletRegistry);
+ MutablePortletApplication one =
portletRegistry.getPortletApplication("PA-001");
+ MutablePortletApplication two =
portletRegistry.getPortletApplication("PA-001");
+ assertEquals(one, two);
+ PortletDefinitionComposite def =
portletRegistry.getPortletDefinitionByUniqueName("PA-001::Portlet-1");
+ assertNotNull(def);
+ assertEquals(def.getPortletApplicationDefinition(), one);
+ assertEquals(def, two.getPortletDefinitions().iterator().next());
+ MutablePortletApplication o =
(MutablePortletApplication)portletRegistry.getPortletApplications().iterator().next();
+ assertEquals(one, o);
+
assertEquals(portletRegistry.getAllPortletDefinitions().iterator().next(), def);
+ }
+
+ private void buildTestData() throws RegistryException, LockFailedException
+ {
+ // start clean
+ Iterator itr = portletRegistry.getPortletApplications().iterator();
+ while (itr.hasNext())
+ {
+ portletRegistry.removeApplication((PortletApplicationDefinition)
itr.next());
+ }
+
+ // Create an Application and a Web app
+
+ PortletApplicationDefinitionImpl app = new
PortletApplicationDefinitionImpl();
+ app.setName("PA-001");
+ UserAttributeRef uaRef = new UserAttributeRefImpl("user-name-family",
"user.name.family");
+ app.addUserAttributeRef(uaRef);
+
+ UserAttribute ua = new UserAttributeImpl("user.name.family", "User
Last Name");
+ app.addUserAttribute(ua);
+
+ JetspeedServiceReference service1 = new
JetspeedServiceReferenceImpl("PortletEntityAccessComponent");
+ app.addJetspeedService(service1);
+ JetspeedServiceReference service2 = new
JetspeedServiceReferenceImpl("PortletRegistryComponent");
+ app.addJetspeedService(service2);
+
+ WebApplicationDefinitionImpl webApp = new
WebApplicationDefinitionImpl();
+ webApp.setContextRoot("/pa-001");
+ webApp.addDescription(Locale.FRENCH, "Description: Le fromage est dans
mon pantalon!");
+ webApp.addDisplayName(Locale.FRENCH, "Display Name: Le fromage est
dans mon pantalon!");
+
+ PortletDefinitionComposite portlet = new PortletDefinitionImpl();
+ portlet.setClassName("org.apache.Portlet");
+ portlet.setName("Portlet-1");
+ portlet.addDescription(Locale.getDefault(), "POrtlet description.");
+ portlet.addDisplayName(Locale.getDefault(), "Portlet display Name.");
+
+ portlet.addInitParameter("testparam", "test value", "This is a test
portlet parameter", Locale.getDefault());
+
+ // PreferenceComposite pc = new PrefsPreference();
+ app.addPortletDefinition(portlet);
+
+ PreferenceSetCtrl prefSetCtrl = (PreferenceSetCtrl)
portlet.getPreferenceSet();
+ PreferenceComposite pc = (PreferenceComposite)
prefSetCtrl.add("preference 1", Arrays.asList(new String[]
+ { "value 1", "value 2" }));
+ pc.addDescription(JetspeedLocale.getDefaultLocale(), "Preference
Description");
+
+ assertNotNull(pc.getValueAt(0));
+
+
portlet.addLanguage(portletRegistry.createLanguage(Locale.getDefault(),
"Portlet 1", "Portlet 1",
+ "This is Portlet 1", null));
+
+ ContentTypeComposite html = new ContentTypeImpl();
+ html.setContentType("html/text");
+ ContentTypeComposite wml = new ContentTypeImpl();
+ html.addPortletMode(new PortletMode("EDIT"));
+ html.addPortletMode(new PortletMode("VIEW"));
+ html.addPortletMode(new PortletMode("HELP"));
+ wml.setContentType("wml");
+ wml.addPortletMode(new PortletMode("HELP"));
+ wml.addPortletMode(new PortletMode("VIEW"));
+ portlet.addContentType(html);
+ portlet.addContentType(wml);
+
+ app.setWebApplicationDefinition(webApp);
+ portletRegistry.updatePortletApplication(app);
+ }
+ /*
+ * @see TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception
+ {
+ Iterator itr = portletRegistry.getPortletApplications().iterator();
+ while (itr.hasNext())
+ {
+ portletRegistry.removeApplication((PortletApplicationDefinition)
itr.next());
+ }
+ }
+
+ protected String[] getConfigurations()
+ {
+ return new String[]
+ { "transaction.xml", "registry-test.xml", "prefs.xml", "cache.xml" };
+ }
+
+}
Modified: portals/jetspeed-2/trunk/etc/db-ojb/ehcache.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/etc/db-ojb/ehcache.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/etc/db-ojb/ehcache.xml (original)
+++ portals/jetspeed-2/trunk/etc/db-ojb/ehcache.xml Wed Feb 14 17:14:08 2007
@@ -339,6 +339,46 @@
memoryStoreEvictionPolicy="LFU"
/>
+ <cache name="portletApplicationOidCache"
+ maxElementsInMemory="500"
+ maxElementsOnDisk="1000"
+ eternal="false"
+ overflowToDisk="false"
+ timeToIdleSeconds="28800"
+ timeToLiveSeconds="28800"
+ memoryStoreEvictionPolicy="LFU"
+ />
+
+ <cache name="portletDefinitionOidCache"
+ maxElementsInMemory="2000"
+ maxElementsOnDisk="1000"
+ eternal="false"
+ overflowToDisk="false"
+ timeToIdleSeconds="28800"
+ timeToLiveSeconds="28800"
+ memoryStoreEvictionPolicy="LFU"
+ />
+
+ <cache name="portletApplicationNameCache"
+ maxElementsInMemory="500"
+ maxElementsOnDisk="1000"
+ eternal="false"
+ overflowToDisk="false"
+ timeToIdleSeconds="28800"
+ timeToLiveSeconds="28800"
+ memoryStoreEvictionPolicy="LFU"
+ />
+
+ <cache name="portletDefinitionNameCache"
+ maxElementsInMemory="2000"
+ maxElementsOnDisk="1000"
+ eternal="false"
+ overflowToDisk="false"
+ timeToIdleSeconds="28800"
+ timeToLiveSeconds="28800"
+ memoryStoreEvictionPolicy="LFU"
+ />
+
<!--
Sample distributed cache named sampleDistributedCache1.
This cache replicates using defaults.
Modified: portals/jetspeed-2/trunk/etc/registration/assembly/registry.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/etc/registration/assembly/registry.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/etc/registration/assembly/registry.xml (original)
+++ portals/jetspeed-2/trunk/etc/registration/assembly/registry.xml Wed Feb 14
17:14:08 2007
@@ -28,7 +28,13 @@
</constructor-arg>
<constructor-arg index="1">
<ref bean="portletFactory" />
- </constructor-arg>
+ </constructor-arg>
+ <constructor-arg index="2">
+ <ref bean="portletApplicationOidCache" />
+ </constructor-arg>
+ <constructor-arg index="3">
+ <ref bean="portletDefinitionOidCache" />
+ </constructor-arg>
</bean>
<bean id="org.apache.jetspeed.components.portletregistry.PortletRegistry"
name="portletRegistry" parent="baseTransactionProxy">
Modified: portals/jetspeed-2/trunk/etc/registration/registration.properties
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/etc/registration/registration.properties?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/etc/registration/registration.properties (original)
+++ portals/jetspeed-2/trunk/etc/registration/registration.properties Wed Feb
14 17:14:08 2007
@@ -1,7 +1,7 @@
# comma-separated list of boot assemblies for Spring
boot.assemblies = repository-datasource-spring.xml
# comma-separated list of assemblies for Spring
-assemblies = registry.xml, transaction.xml
+assemblies = registry.xml, transaction.xml, cache.xml
# overwrite portlet applications flag, set to true to replace existing portlet
applications
overwrite.apps = true
# registry component name
Modified:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCache.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCache.java?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCache.java
(original)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCache.java
Wed Feb 14 17:14:08 2007
@@ -18,7 +18,7 @@
/**
* <p>
* Provides interface to Jetspeed for cache related activities
- * Abstraction around atual cache implementation
+ * Abstraction around actual cache implementation
* </p>
*
* @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
@@ -35,6 +35,12 @@
CacheElement get(Object key);
/**
+ * clear all content in the cache
+ *
+ */
+ void clear();
+
+ /**
* Put an object into the cache, adding it, or replacing if exists
* @param object
*/
@@ -85,4 +91,13 @@
* @return
*/
String createCacheKey(String primary, String secondary);
+
+ /**
+ * Add a cache listener for supported cache events
+ *
+ * @param listener
+ */
+ void addEventListener(JetspeedCacheEventListener listener);
+
+ void removeEventListener(JetspeedCacheEventListener listener);
}
Added:
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCacheEventListener.java
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCacheEventListener.java?view=auto&rev=507766
==============================================================================
---
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCacheEventListener.java
(added)
+++
portals/jetspeed-2/trunk/jetspeed-api/src/java/org/apache/jetspeed/cache/JetspeedCacheEventListener.java
Wed Feb 14 17:14:08 2007
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2000-2001,2004 The Apache Software Foundation.
+ *
+ * Licensed 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.cache;
+
+/**
+ * <p>
+ * Provides interface to Jetspeed for cache events
+ * </p>
+ *
+ * @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a>
+ * @version $Id: $
+ */
+public interface JetspeedCacheEventListener
+{
+ void notifyElementRemoved(JetspeedCache cache, Object o);
+}
\ No newline at end of file
Modified: portals/jetspeed-2/trunk/maven.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/maven.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/maven.xml (original)
+++ portals/jetspeed-2/trunk/maven.xml Wed Feb 14 17:14:08 2007
@@ -349,7 +349,7 @@
<goal name='mht'>
<attainGoal name='j2:portal.conf.sql'/>
<attainGoal name='j2:db.create.test'/>
- <attainGoal name='test.register'/>
+ <!-- <attainGoal name='test.register'/> -->
<echo>and the holy ghost...run your test... dont forget
-Dmaven.test.skip=false</echo>
</goal>
@@ -379,7 +379,9 @@
file="./src/webapp/WEB-INF/assembly/transaction.xml"/>
<copy todir="${maven.build.dir}/classes"
file="./etc/registration/assembly/registry.xml"/>
- <java
classname="org.apache.jetspeed.tools.registration.RegistrationTool" fork="yes">
+ <copy todir="${maven.build.dir}/classes"
+ file="./src/webapp/WEB-INF/assembly/cache.xml"/>
+ <java
classname="org.apache.jetspeed.tools.registration.RegistrationTool" fork="yes">
<classpath>
<path refid="maven.dependency.classpath"/>
<pathelement path="${maven.build.dest}"/>
Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/cache.xml Wed Feb 14
17:14:08 2007
@@ -32,7 +32,7 @@
<property name="cacheName" value="portletContentCache"/>
</bean>
-<bean id="portletContentCache"
class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+<bean id="portletContentCache"
class="org.apache.jetspeed.cache.impl.EhPortletContentCacheImpl">
<constructor-arg>
<ref bean="ehPortletContentCache"/>
</constructor-arg>
@@ -51,5 +51,52 @@
</constructor-arg>
</bean>
+<bean id="ehPortletApplicationOidCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+<property name="cacheManager">
+<ref local="cacheManager"/>
+</property>
+ <property name="cacheName" value="portletApplicationOidCache"/>
+</bean>
+<bean id="ehPortletApplicationNameCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+<property name="cacheManager">
+<ref local="cacheManager"/>
+</property>
+ <property name="cacheName" value="portletApplicationNameCache"/>
+</bean>
+
+<bean id="portletApplicationOidCache"
class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+ <constructor-arg>
+ <ref bean="ehPortletApplicationOidCache"/>
+ </constructor-arg>
+</bean>
+<bean id="portletApplicationNameCache"
class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+ <constructor-arg>
+ <ref bean="ehPortletApplicationNameCache"/>
+ </constructor-arg>
+</bean>
+
+<bean id="ehPortletDefinitionOidCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+<property name="cacheManager">
+<ref local="cacheManager"/>
+</property>
+ <property name="cacheName" value="portletDefinitionOidCache"/>
+</bean>
+<bean id="ehPortletDefinitionNameCache"
class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+<property name="cacheManager">
+<ref local="cacheManager"/>
+</property>
+ <property name="cacheName" value="portletDefinitionNameCache"/>
+</bean>
+
+<bean id="portletDefinitionOidCache"
class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+ <constructor-arg>
+ <ref bean="ehPortletDefinitionOidCache"/>
+ </constructor-arg>
+</bean>
+<bean id="portletDefinitionNameCache"
class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+ <constructor-arg>
+ <ref bean="ehPortletDefinitionNameCache"/>
+ </constructor-arg>
+</bean>
</beans>
Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/registry.xml
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/registry.xml?view=diff&rev=507766&r1=507765&r2=507766
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/registry.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/registry.xml Wed Feb
14 17:14:08 2007
@@ -29,6 +29,12 @@
<constructor-arg index="1">
<ref bean="portletFactory" />
</constructor-arg>
+ <constructor-arg index="2">
+ <ref bean="portletApplicationOidCache" />
+ </constructor-arg>
+ <constructor-arg index="3">
+ <ref bean="portletDefinitionOidCache" />
+ </constructor-arg>
</bean>
<bean id="org.apache.jetspeed.components.portletregistry.PortletRegistry"
name="portletRegistry" parent="baseTransactionProxy">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]