portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r724571 [2/3] - in /portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade: ./ components/jetspeed-cm/ components/jetspeed-cm/src/main/java/org/apache/jetspeed/cache/impl/ components/jetspeed-page-manager/ components/jetspeed-page-man...
Date Tue, 09 Dec 2008 01:50:18 GMT
Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java?rev=724571&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestDatabasePageManagerCache.java Mon Dec  8 17:50:16 2008
@@ -0,0 +1,598 @@
+/*
+ * 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.page.cache;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.cache.impl.EhCacheConfigResource;
+
+/**
+ * TestDatabasePageManagerCache
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class TestDatabasePageManagerCache extends TestCase
+{
+    protected static Log log = LogFactory.getLog(TestDatabasePageManagerCache.class);
+    
+    // Members
+    
+    private String osExecutableExtension;
+    private String fileSeparator;
+    private File javaExecutablePath;
+    private String classPathSeparator;
+    private File projectDirectoryPath;
+    private Map<String,String> systemProperties;
+    private String classPath;
+ 
+    // Test methods
+    
+    /**
+     * Tests distributed cache operation for DatabasePageManager
+     */
+    public void testDatabasePageManagerCache()
+    {
+        String result;
+        
+        // create and start servers
+        final TestProgram server0 = new TestProgram("server-0", DatabasePageManagerServer.class, 0);
+        final TestProgram server1 = new TestProgram("server-1", DatabasePageManagerServer.class, 1);
+        try
+        {
+            // start servers
+            server0.start();
+            server1.start();
+
+            // wait until servers have started
+            server0.execute("");
+            server1.execute("");
+
+            // check to ensure servers have distributed page manager caches
+            boolean server0Distributed = false;
+            boolean server1Distributed = false;
+            final long distributedCheckStarted = System.currentTimeMillis();
+            do
+            {
+                // check servers
+                if (!server0Distributed)
+                {
+                    result = server0.execute("pageManager.isDistributed();");
+                    assertTrue(!result.contains("Exception"));
+                    server0Distributed = result.endsWith("true");
+                }
+                if (!server1Distributed)
+                {
+                    result = server1.execute("pageManager.isDistributed();");
+                    assertTrue(!result.contains("Exception"));
+                    server1Distributed = result.endsWith("true");
+                }
+                
+                // wait if servers not distributed
+                if (!server0Distributed || !server1Distributed)
+                {
+                    Thread.sleep(250);
+                }
+            }
+            while ((!server0Distributed || !server1Distributed) && (System.currentTimeMillis()-distributedCheckStarted < 5000));
+            if (!server0Distributed && !server1Distributed)
+            {                
+                System.out.println("Server page managers not distributed: possible system limitation... test skipped");
+                log.warn("Server page managers not distributed: possible system limitation... test skipped");
+                return;
+            }
+            assertTrue(server0Distributed);
+            assertTrue(server1Distributed);
+
+            // clean and setup database page managers
+            result = server0.execute("removeRootFolder = pageManager.getFolder(\"/\");");
+            if (!result.contains("FolderNotFoundException"))
+            {
+                result = server0.execute("pageManager.removeFolder(removeRootFolder);");
+                assertTrue(!result.contains("Exception"));
+            }
+            result = server0.execute("pageManager.reset();");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.reset();");
+            assertTrue(!result.contains("Exception"));
+            
+            // create folder and documents in first page manager
+            result = server0.execute("folder = pageManager.newFolder(\"/\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("folder.setTitle(\"Root Folder\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updateFolder(folder);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page = pageManager.newPage(\"/default-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page.setTitle(\"Default Page\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page = pageManager.newPage(\"/another-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page.setTitle(\"Another Page\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page = pageManager.newPage(\"/some-other-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page.setTitle(\"Some Other Page\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("link = pageManager.newLink(\"/default.link\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("link.setTitle(\"Default Link\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("link.setUrl(\"http://www.default.org/\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updateLink(link);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("folder = pageManager.newFolder(\"/deep-0\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("folder.setTitle(\"Deep 0 Folder\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updateFolder(folder);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page = pageManager.newPage(\"/deep-0/deep-page-0.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page.setTitle(\"Deep Page 0\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("folder = pageManager.newFolder(\"/deep-1\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("folder.setTitle(\"Deep 1 Folder\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updateFolder(folder);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page = pageManager.newPage(\"/deep-1/deep-page-1.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("page.setTitle(\"Deep Page 1\");");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageSecurity = pageManager.newPageSecurity();");
+            assertTrue(!result.contains("Exception"));
+            result = server0.execute("pageManager.updatePageSecurity(pageSecurity);");
+            assertTrue(!result.contains("Exception"));
+
+            // populate folders and documents in second page manager
+            result = server1.execute("pageManager.getFolder(\"/\").getTitle();");
+            assertTrue(result.endsWith("Root Folder"));
+            result = server1.execute("pageManager.getPage(\"/default-page.psml\").getTitle();");
+            assertTrue(result.endsWith("Default Page"));
+            result = server1.execute("pageManager.getPage(\"/another-page.psml\").getTitle();");
+            assertTrue(result.endsWith("Another Page"));
+            result = server1.execute("pageManager.getPage(\"/some-other-page.psml\").getTitle();");
+            assertTrue(result.endsWith("Some Other Page"));            
+            result = server1.execute("pageManager.getLink(\"/default.link\").getTitle();");
+            assertTrue(result.endsWith("Default Link"));
+            result = server1.execute("pageManager.getFolder(\"/deep-0\").getTitle();");
+            assertTrue(result.endsWith("Deep 0 Folder"));
+            result = server1.execute("pageManager.getPage(\"/deep-0/deep-page-0.psml\").getTitle();");
+            assertTrue(result.endsWith("Deep Page 0"));
+            result = server1.execute("pageManager.getFolder(\"/deep-1\").getTitle();");
+            assertTrue(result.endsWith("Deep 1 Folder"));
+            result = server1.execute("pageManager.getPage(\"/deep-1/deep-page-1.psml\").getTitle();");
+            assertTrue(result.endsWith("Deep Page 1"));
+            result = server1.execute("pageManager.getPageSecurity().getPath();");
+            assertTrue(result.endsWith("/page.security"));
+            
+            // update/remove objects in second page manager
+            result = server1.execute("page = pageManager.getPage(\"/default-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("page.setTitle(\"Edited Default Page\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.updatePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("page = pageManager.getPage(\"/some-other-page.psml\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.removePage(page);");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("link = pageManager.getLink(\"/default.link\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("link.setTitle(\"Edited Default Link\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.updateLink(link);");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("folder = pageManager.getFolder(\"/deep-0\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("folder.setTitle(\"Edited Deep 0 Folder\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.updateFolder(folder);");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("folder = pageManager.getFolder(\"/deep-1\");");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.removeFolder(folder);");
+            assertTrue(!result.contains("Exception"));            
+            
+            // test objects in both page managers for cache coherency
+            result = server1.execute("pageManager.getPage(\"/default-page.psml\").getTitle();");
+            assertTrue(result.endsWith("Edited Default Page"));
+            result = server1.execute("pageManager.getPage(\"/some-other-page.psml\");");
+            assertTrue(result.contains("PageNotFoundException"));
+            result = server1.execute("pageManager.getFolder(\"/\").getPages().size();");
+            assertTrue(result.endsWith("2"));
+            result = server1.execute("pageManager.getLink(\"/default.link\").getTitle();");
+            assertTrue(result.endsWith("Edited Default Link"));
+            result = server1.execute("pageManager.getFolder(\"/deep-0\").getTitle();");
+            assertTrue(result.endsWith("Edited Deep 0 Folder"));
+            result = server1.execute("pageManager.getPage(\"/deep-1/deep-page-1.psml\");");
+            assertTrue(result.contains("PageNotFoundException"));
+            result = server1.execute("pageManager.getFolder(\"/deep-1\");");
+            assertTrue(result.contains("FolderNotFoundException"));
+            result = server1.execute("pageManager.getFolder(\"/\").getFolders().size();");
+            assertTrue(result.endsWith("1"));
+            boolean defaultPageUpdated = false;
+            boolean someOtherPageRemoved = false;
+            boolean rootFolderPagesCountTwo = false;
+            boolean defaultLinkUpdated = false;
+            boolean deep0FolderUpdated = false;
+            boolean deepPage1Removed = false;
+            boolean deep1FolderRemoved = false;
+            boolean rootFolderFoldersCountOne = false;
+            final long coherencyCheckStarted = System.currentTimeMillis();
+            do
+            {
+                // check cache coherency
+                if (!defaultPageUpdated)
+                {
+                    result = server0.execute("pageManager.getPage(\"/default-page.psml\").getTitle();");
+                    defaultPageUpdated = result.endsWith("Edited Default Page");
+                }
+                if (!someOtherPageRemoved)
+                {
+                    result = server0.execute("pageManager.getPage(\"/some-other-page.psml\");");
+                    someOtherPageRemoved = result.contains("PageNotFoundException");
+                }
+                if (!rootFolderPagesCountTwo)
+                {
+                    result = server0.execute("pageManager.getFolder(\"/\").getPages().size();");
+                    rootFolderPagesCountTwo = result.endsWith("2");
+                }
+                if (!defaultLinkUpdated)
+                {
+                    result = server0.execute("pageManager.getLink(\"/default.link\").getTitle();");
+                    defaultLinkUpdated = result.endsWith("Edited Default Link");
+                }
+                if (!deep0FolderUpdated)
+                {
+                    result = server0.execute("pageManager.getFolder(\"/deep-0\").getTitle();");
+                    deep0FolderUpdated = result.endsWith("Edited Deep 0 Folder");
+                }
+                if (!deepPage1Removed)
+                {
+                    result = server0.execute("pageManager.getPage(\"/deep-1/deep-page-1.psml\");");
+                    deepPage1Removed = result.contains("PageNotFoundException");
+                }
+                if (!deep1FolderRemoved)
+                {
+                    result = server0.execute("pageManager.getFolder(\"/deep-1\");");
+                    deep1FolderRemoved = result.contains("FolderNotFoundException");
+                }
+                if (!rootFolderFoldersCountOne)
+                {
+                    result = server0.execute("pageManager.getFolder(\"/\").getFolders().size();");
+                    rootFolderFoldersCountOne = result.endsWith("1");
+                }
+                
+                // wait for cache coherency
+                if (!defaultPageUpdated || !someOtherPageRemoved || !rootFolderPagesCountTwo || !defaultLinkUpdated || !deep0FolderUpdated || !deepPage1Removed || !deep1FolderRemoved || !rootFolderFoldersCountOne)
+                {
+                    Thread.sleep(250);
+                }
+            }
+            while ((!defaultPageUpdated || !someOtherPageRemoved || !rootFolderPagesCountTwo || !defaultLinkUpdated || !deep0FolderUpdated || !deepPage1Removed || !deep1FolderRemoved || !rootFolderFoldersCountOne) && (System.currentTimeMillis()-coherencyCheckStarted < 5000));
+            assertTrue(defaultPageUpdated);
+            assertTrue(someOtherPageRemoved);
+            assertTrue(rootFolderPagesCountTwo);
+            assertTrue(defaultLinkUpdated);
+            assertTrue(deep0FolderUpdated);
+            assertTrue(deepPage1Removed);
+            assertTrue(deep1FolderRemoved);
+            assertTrue(rootFolderFoldersCountOne);
+
+            // reset database page managers
+            result = server0.execute("pageManager.reset();");
+            assertTrue(!result.contains("Exception"));
+            result = server1.execute("pageManager.reset();");
+            assertTrue(!result.contains("Exception"));
+        }
+        catch (final Exception e)
+        {
+            log.error("Server test exception: "+e, e);
+            fail( "Server test exception: "+e);            
+        }        
+        finally
+        {
+            // silently shutdown servers
+            try
+            {
+                server0.shutdown();
+            }
+            catch (final Exception e)
+            {
+                log.error( "Server shutdown exception: "+e, e);
+            }
+            try
+            {
+                server1.shutdown();
+            }
+            catch (final Exception e)
+            {
+                log.error( "Server shutdown exception: "+e, e);
+            }
+        }
+    }
+    
+    // Implementation classes
+    
+    protected class TestProgram
+    {
+        private String name;
+        private Class<?> mainClass;
+        private int index;
+
+        private Process process;
+        private BufferedWriter processInput;
+        private BufferedReader processOutput;
+        
+        public TestProgram(final String name, final Class<?> mainClass, final int index)
+        {
+            this.name = name;
+            this.mainClass = mainClass;
+            this.index = index;
+        }
+        
+        public synchronized void start() throws IOException
+        {
+            assertNull(process);
+
+            // configure launcher with paths, properties, and indexed properties
+            final ProcessBuilder launcher = new ProcessBuilder();
+            final List<String> commandAndArgs = new ArrayList<String>();
+            commandAndArgs.add(javaExecutablePath.getCanonicalPath());
+            for (Map.Entry<String,String> systemProperty : systemProperties.entrySet())
+            {
+                final String propertyName = systemProperty.getKey();
+                String propertyValue = systemProperty.getValue();
+                if (propertyName.equals(EhCacheConfigResource.EHCACHE_PORT_PROP_NAME))
+                {
+                    propertyValue = Integer.toString(Integer.parseInt(propertyValue)+index);
+                }
+                commandAndArgs.add( "-D"+propertyName+"="+propertyValue);
+            }
+            commandAndArgs.add("-Dlog4j.configuration=log4j-stdout.properties");
+            commandAndArgs.add("-classpath");
+            commandAndArgs.add(classPath);
+            commandAndArgs.add(mainClass.getName());
+            log.info("Launcher command for "+name+": "+commandAndArgs);
+            launcher.command(commandAndArgs);
+            launcher.directory(projectDirectoryPath);
+            launcher.redirectErrorStream(true);
+
+            // launch test programs
+            process = launcher.start();
+
+            // setup I/O for process
+            processInput = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
+            processOutput = new BufferedReader(new InputStreamReader(process.getInputStream()));
+
+            // read messages from process
+            for (String line; (processOutput.ready() && ((line = processOutput.readLine()) != null));)
+            {
+                logProcessLine(line);
+            }
+        }
+
+        public synchronized String execute(final String scriptLine) throws IOException
+        {
+            assertNotNull(process);
+
+            // read messages from process
+            for (String line; (processOutput.ready() && ((line = processOutput.readLine()) != null));)
+            {
+                logProcessLine(line);
+            }
+
+            // write script line to process
+            processInput.write(scriptLine);
+            processInput.newLine();
+            processInput.flush();
+
+            // read result or messages from process
+            String resultLine = null;
+            for (String line; ((line = processOutput.readLine()) != null);)
+            {
+                if (! line.startsWith(DatabasePageManagerServer.SCRIPT_RESULT_LINE_PREFIX))
+                {
+                    logProcessLine(line);
+                }
+                else
+                {
+                    resultLine = line;
+                    break;
+                }
+            }
+            if ( resultLine == null)
+            {
+                throw new IOException("Unexpected EOF from process output");
+            }
+            return resultLine;
+        }
+        
+        public synchronized void shutdown() throws IOException, InterruptedException
+        {
+            assertNotNull( process);
+
+            // start thread to destroy process on timeout
+            final Thread destroyThread = new Thread(new Runnable()
+            {
+                public void run()
+                {
+                    try
+                    {
+                        Thread.sleep(10000);
+                        if ( process != null)
+                        {
+                            log.warn( "Forcibly stopping "+name);
+                            process.destroy();
+                        }
+                    }
+                    catch ( final Exception e)
+                    {
+                    }
+                }
+            }, "DestroyThread");
+            destroyThread.setDaemon( true);
+            destroyThread.start();
+
+            // close process input to shutdown server and read messages
+            processInput.close();
+            for (String line; ((line = processOutput.readLine()) != null);)
+            {
+                logProcessLine(line);
+            }
+
+            // join on process completion
+            process.waitFor();
+            processOutput.close();
+            process = null;
+
+            // join on destroy thread
+            destroyThread.interrupt();
+            destroyThread.join();
+        }
+        
+        private void logProcessLine(final String line)
+        {
+            if (!line.contains("INFO") && (line.contains("ERROR") || line.contains("Exception") || line.startsWith("   at ")))
+            {
+                log.error("{"+name+"} "+line);
+            }
+            else
+            {
+                log.info("{"+name+"} "+line);                        
+            }
+        }
+    }
+    
+    // TestCase implementation
+    
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception
+    {
+        // setup cache properties
+        EhCacheConfigResource.getInstance(EhCacheConfigResource.EHCACHE_CONFIG_RESOURCE_DISTRIBUTED_CACHE, true);
+        
+        // environment setup
+        osExecutableExtension = (System.getProperty("os.name").startsWith("Windows") ? ".exe" : "");
+        fileSeparator = System.getProperty("file.separator");
+        javaExecutablePath = new File(System.getProperty("java.home")+fileSeparator+"bin"+fileSeparator+"java"+osExecutableExtension);
+        classPathSeparator = System.getProperty("path.separator");
+        projectDirectoryPath = new File(System.getProperty("basedir"));
+        systemProperties = new HashMap<String,String>();
+        for (final Map.Entry<Object,Object> systemProperty : System.getProperties().entrySet())
+        {
+            final String propertyName = systemProperty.getKey().toString();
+            final String propertyValue = systemProperty.getValue().toString();
+            if (propertyName.startsWith("org.apache.jetspeed.") || propertyName.startsWith("java.net.") || propertyName.equals("basedir"))
+            {
+                systemProperties.put(propertyName, propertyValue);
+            }
+        }
+
+        // construct launcher classpath from current class loader
+        final StringBuilder classPathBuilder = new StringBuilder();
+        final ClassLoader loader = this.getClass().getClassLoader();
+        assertTrue(loader instanceof URLClassLoader);
+        final URLClassLoader urlLoader = (URLClassLoader)loader;
+        assertNotNull(urlLoader.getURLs());
+        for (final URL pathURL : urlLoader.getURLs())
+        {
+            // convert path URL to file path
+            String path = pathURL.getPath().replace("/", fileSeparator);
+            if (path.endsWith(fileSeparator))
+            {
+                path = path.substring(0, path.length()-fileSeparator.length());
+            }
+
+            // build class path
+            if (classPathBuilder.length() > 0)
+            {
+                classPathBuilder.append(classPathSeparator);
+            }
+            classPathBuilder.append(path);
+        }
+        classPath = classPathBuilder.toString();
+        assertTrue(classPath.length() > 0);
+
+        // continue setup
+        super.setUp();
+    }
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+    }
+    
+    // Application entry point
+
+    /**
+     * Start the tests.
+     * 
+     * @param args not used
+     */
+    public static void main(final String [] args)
+    {
+        junit.awtui.TestRunner.main(new String[]{TestDatabasePageManagerCache.class.getName()});
+    }
+
+    /**
+     * Creates the test suite.
+     * 
+     * @return a test suite that includes all methods starting with "test"
+     */
+    public static Test suite()
+    {
+        return new TestSuite(TestDatabasePageManagerCache.class);
+    }
+}

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml?rev=724571&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager-base.xml Mon Dec  8 17:50:16 2008
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+    <!-- Page Manager Caches -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+        <property name="test" value="true"/>
+    </bean>
+
+    <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
+        <property name="configLocation" ref="cacheManagerConfig"/>
+    </bean>
+
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
+    <!-- Transaction Proxying -->
+    <bean id="pageManagerInterceptor" class="org.apache.jetspeed.util.interceptors.PageManagerInterceptor">
+    </bean>
+
+    <bean id="pageManager" parent="baseTransactionProxy">
+        <property name="proxyInterfaces">
+            <value>org.apache.jetspeed.page.PageManager</value>
+        </property>
+        <property name="target">
+            <ref bean="pageManagerImpl" />
+        </property>
+        <property name="transactionAttributes">
+            <props>
+              <prop key="getPage*">PROPAGATION_SUPPORTS</prop>  
+              <prop key="getLink*">PROPAGATION_SUPPORTS</prop>  
+              <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>  
+              <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>  
+              <prop key="getAll">PROPAGATION_SUPPORTS</prop>  
+              <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>  
+              <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>                            
+              <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
+              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>              
+              <prop key="folderExists">PROPAGATION_SUPPORTS</prop>  
+              <prop key="pageExists">PROPAGATION_SUPPORTS</prop>  
+              <prop key="linkExists">PROPAGATION_SUPPORTS</prop>  
+              <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>  
+              <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>  
+            </props>
+        </property>
+        <property name="preInterceptors"> 
+            <list>
+                <ref bean="pageManagerInterceptor" />
+            </list>
+        </property>
+    </bean>
+
+    <!-- Inject Page Manager Proxy into Page Manager -->
+    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
+        <property name="targetObject"><ref bean="pageManagerImpl"/></property>
+        <property name="targetMethod"><value>setPageManagerProxy</value></property>
+        <property name="arguments">
+            <list>
+                <ref bean="pageManager"/>
+            </list>
+        </property>
+    </bean>
+
+</beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/database-page-manager.xml Mon Dec  8 17:50:16 2008
@@ -18,66 +18,21 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-    
+
+    <import resource="database-page-manager-base.xml"/>
+
     <!-- Page Manager -->
-    <bean id="org.apache.jetspeed.page.PageManagerImpl" 
-          name="pageManagerImpl"
-          init-method="init"
-          class="org.apache.jetspeed.page.impl.DatabasePageManager">
+    <bean id="pageManagerImpl" init-method="init" class="org.apache.jetspeed.page.impl.DatabasePageManager">
         <!-- OJB configuration file resource path -->
-        <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
-        <!-- folder/page/link cache size, default=128, min=128 -->
-        <constructor-arg index="1"><value>128</value></constructor-arg>
-        <!-- folder/page/link cache expires seconds, default=150, infinite=0, min=30 -->
-        <constructor-arg index="2"><value>0</value></constructor-arg>
+        <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>
         <!-- permissions security enabled flag, default=false -->
-        <constructor-arg index="3"><value>false</value></constructor-arg>
+        <constructor-arg index="1"><value>false</value></constructor-arg>
         <!-- constraints security enabled flag, default=true -->
-        <constructor-arg index="4"><value>false</value></constructor-arg>
-    </bean>
-
-    <!-- Transaction Proxying -->
-    <bean id="org.apache.jetspeed.page.PageManager" name="pageManager" parent="baseTransactionProxy">
-        <property name="proxyInterfaces">
-            <value>org.apache.jetspeed.page.PageManager</value>
-        </property>
-        <property name="target">
-            <ref bean="pageManagerImpl" />
-        </property>
-        <property name="transactionAttributes">
-            <props>
-              <prop key="getPage*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getLink*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getAll">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>  
-              <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>                            
-              <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>              
-              <prop key="folderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="linkExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>  
-            </props>
-        </property>
-    </bean>
-
-    <!-- Inject Page Manager Proxy into Page Manager -->
-    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-        <property name="targetObject"><ref bean="pageManagerImpl"/></property>
-        <property name="targetMethod"><value>setPageManagerProxy</value></property>
-        <property name="arguments">
-            <list>
-                <ref bean="pageManager"/>
-            </list>
-        </property>
+        <constructor-arg index="2"><value>false</value></constructor-arg>
+        <!-- folder/page/link cache -->
+        <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+        <!-- folder/page/link path cache -->
+        <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml?rev=724571&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/distributed-ehcache.xml Mon Dec  8 17:50:16 2008
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
+
+    <diskStore path="java.io.tmpdir"/>
+
+    <cacheManagerEventListenerFactory class=""
+                                      properties=""/>
+
+
+    <cacheManagerPeerProviderFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                                     properties="peerDiscovery=automatic,
+                                                 multicastGroupAddress=${org.apache.jetspeed.ehcache.group.address},
+                                                 multicastGroupPort=${org.apache.jetspeed.ehcache.group.port},
+                                                 timeToLive=${org.apache.jetspeed.ehcache.group.ttl}"/>
+
+    <cacheManagerPeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
+                                     properties="hostName=${org.apache.jetspeed.ehcache.hostname},
+                                                 port=${org.apache.jetspeed.ehcache.port}"/>
+
+    <defaultCache maxElementsInMemory="10000"
+                  eternal="false"
+                  timeToIdleSeconds="120"
+                  timeToLiveSeconds="120"
+                  overflowToDisk="true"
+                  maxElementsOnDisk="10000000"
+                  diskPersistent="false"
+                  diskExpiryThreadIntervalSeconds="120"
+                  memoryStoreEvictionPolicy="LRU"/>
+
+    <cache name="pageManagerOidCache"
+           maxElementsInMemory="${org.apache.jetspeed.ehcache.pagemanager.maxelements}"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           timeToLiveSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           memoryStoreEvictionPolicy="LFU"/>
+
+    <cache name="pageManagerPathCache"
+           maxElementsInMemory="${org.apache.jetspeed.ehcache.pagemanager.maxelements}"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           timeToLiveSeconds="${org.apache.jetspeed.ehcache.pagemanager.element.ttl}"
+           memoryStoreEvictionPolicy="LFU">
+        <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
+                                   properties="replicateAsynchronously=true,
+                                               replicatePuts=false,
+                                               replicateUpdates=false,
+                                               replicateUpdatesViaCopy=false,
+                                               replicateRemovals=true"/>
+    </cache>
+
+    <cache name="pageFileCache"
+           maxElementsInMemory="${org.apache.jetspeed.ehcache.pagemanager.maxfiles}"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="0"
+           timeToLiveSeconds="0"
+           memoryStoreEvictionPolicy="LFU"/>
+
+</ehcache>

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/ehcache.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/ehcache.xml?rev=724571&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/ehcache.xml (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/ehcache.xml Mon Dec  8 17:50:16 2008
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
+
+    <diskStore path="java.io.tmpdir"/>
+
+    <cacheManagerEventListenerFactory class=""
+                                      properties=""/>
+
+    <defaultCache maxElementsInMemory="10000"
+                  eternal="false"
+                  timeToIdleSeconds="120"
+                  timeToLiveSeconds="120"
+                  overflowToDisk="true"
+                  maxElementsOnDisk="10000000"
+                  diskPersistent="false"
+                  diskExpiryThreadIntervalSeconds="120"
+                  memoryStoreEvictionPolicy="LRU"/>
+
+    <cache name="pageManagerOidCache"
+           maxElementsInMemory="128"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="150"
+           timeToLiveSeconds="150"
+           memoryStoreEvictionPolicy="LFU"/>
+
+    <cache name="pageManagerPathCache"
+           maxElementsInMemory="128"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="150"
+           timeToLiveSeconds="150"
+           memoryStoreEvictionPolicy="LFU"/>
+
+    <cache name="pageFileCache"
+           maxElementsInMemory="100"
+           eternal="false"
+           overflowToDisk="false"
+           timeToIdleSeconds="0"
+           timeToLiveSeconds="0"
+           memoryStoreEvictionPolicy="LFU"/>
+
+</ehcache>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/interceptors.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/interceptors.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/interceptors.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/interceptors.xml Mon Dec  8 17:50:16 2008
@@ -20,33 +20,11 @@
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
     <!--
-    Database PSML Manager Interception for handling Cache Rollback
-    We also have examples here of replay interception for failover to 
+    Examples of replay interception for failover to 
     a second database on update failures
-   -->    
-
-    <bean id="pageManagerInterceptor" class="org.apache.jetspeed.util.interceptors.PageManagerInterceptor">
-    </bean>
-
-
-    <bean id="PageManagerTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
-                        abstract="true">
-        <property name="transactionManager"><ref bean="transactionManager"/></property>
-        <property name="transactionAttributes">
-            <props>
-                <prop key="*">PROPAGATION_REQUIRED</prop>
-            </props>
-        </property>
-        <property name="preInterceptors"> 
-            <list>
-                <ref local="pageManagerInterceptor" />
-            </list>
-        </property>
-    </bean>
+    -->    
 
     <!--    
-        Replay support:
-        
     <bean id="replayTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
                         abstract="true">
         <property name="transactionManager"><ref bean="transactionManager"/></property>
@@ -62,7 +40,7 @@
         </property>
     </bean>
         
-   <bean id="replayDecisionMakerBean"
+    <bean id="replayDecisionMakerBean"
         class="org.apache.jetspeed.util.interceptors.TransactionalMethodReplayDecisionMaker">
         <property name="sqlErrorCodes">
             <value>9999, 400, -80</value> 
@@ -80,6 +58,6 @@
             <ref bean="replayDecisionMakerBean"/>
         </property>
     </bean>
- -->
+    -->
             
 </beans>

Added: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/log4j-stdout.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/log4j-stdout.properties?rev=724571&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/log4j-stdout.properties (added)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/log4j-stdout.properties Mon Dec  8 17:50:16 2008
@@ -0,0 +1,31 @@
+# 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.
+
+# ------------------------------------------------------------------------
+#
+# Stdout Logging Configuration
+#
+# $Id: log4j.properties 722139 2008-12-01 17:22:03Z rwatler $
+#
+# ------------------------------------------------------------------------
+
+log4j.rootLogger = ERROR, stdout
+
+log4j.category.org.apache.jetspeed = INFO, stdout
+log4j.additivity.org.apache.jetspeed = false
+
+log4j.appender.stdout = org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.conversionPattern = %d [%t] %-5p %c - %m%n

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-database-page-manager.xml Mon Dec  8 17:50:16 2008
@@ -19,65 +19,20 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <import resource="database-page-manager-base.xml"/>
+
     <!-- Page Manager -->
-    <bean id="org.apache.jetspeed.page.PageManagerImpl" 
-          name="securePageManagerImpl"
-          init-method="init"
-          class="org.apache.jetspeed.page.impl.DatabasePageManager">
+    <bean id="pageManagerImpl" init-method="init" class="org.apache.jetspeed.page.impl.DatabasePageManager">
         <!-- OJB configuration file resource path -->
         <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
-        <!-- folder/page/link cache size, default=128, min=128 -->
-        <constructor-arg index="1"><value>128</value></constructor-arg>
-        <!-- folder/page/link cache expires seconds, default=150, infinite=0, min=30 -->
-        <constructor-arg index="2"><value>0</value></constructor-arg>
         <!-- permissions security enabled flag, default=false -->
-        <constructor-arg index="3"><value>false</value></constructor-arg>
+        <constructor-arg index="1"><value>false</value></constructor-arg>
         <!-- constraints security enabled flag, default=true -->
-        <constructor-arg index="4"><value>true</value></constructor-arg>
-    </bean>
-
-    <!-- Transaction Proxying -->
-    <bean id="org.apache.jetspeed.page.PageManager" name="pageManager" parent="baseTransactionProxy">
-        <property name="proxyInterfaces">
-            <value>org.apache.jetspeed.page.PageManager</value>
-        </property>
-        <property name="target">
-            <ref bean="securePageManagerImpl" />
-        </property>
-        <property name="transactionAttributes">
-            <props>
-              <prop key="getPage*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getLink*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getAll">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>  
-              <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>                            
-              <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>              
-              <prop key="folderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="linkExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>  
-            </props>
-        </property>
-    </bean>
-
-    <!-- Inject Page Manager Proxy into Page Manager -->
-    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-        <property name="targetObject"><ref bean="securePageManagerImpl"/></property>
-        <property name="targetMethod"><value>setPageManagerProxy</value></property>
-        <property name="arguments">
-            <list>
-                <ref bean="pageManager"/>
-            </list>
-        </property>
+        <constructor-arg index="2"><value>true</value></constructor-arg>
+        <!-- folder/page/link cache -->
+        <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+        <!-- folder/page/link path cache -->
+        <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-page-manager/src/test/resources/secure-permissions-database-page-manager.xml Mon Dec  8 17:50:16 2008
@@ -19,65 +19,20 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <import resource="database-page-manager-base.xml"/>
+
     <!-- Page Manager -->
-    <bean id="org.apache.jetspeed.page.PageManagerImpl" 
-          name="securePermissionsPageManagerImpl"
-          init-method="init"
-          class="org.apache.jetspeed.page.impl.DatabasePageManager">
+    <bean name="pageManagerImpl" init-method="init" class="org.apache.jetspeed.page.impl.DatabasePageManager">
         <!-- OJB configuration file resource path -->
         <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
-        <!-- folder/page/link cache size, default=128, min=128 -->
-        <constructor-arg index="1"><value>128</value></constructor-arg>
-        <!-- folder/page/link cache expires seconds, default=150, infinite=0, min=30 -->
-        <constructor-arg index="2"><value>0</value></constructor-arg>
         <!-- permissions security enabled flag, default=false -->
-        <constructor-arg index="3"><value>true</value></constructor-arg>
+        <constructor-arg index="1"><value>true</value></constructor-arg>
         <!-- constraints security enabled flag, default=true -->
-        <constructor-arg index="4"><value>false</value></constructor-arg>
-    </bean>
-
-    <!-- Transaction Proxying -->
-    <bean id="org.apache.jetspeed.page.PageManager" name="pageManager" parent="baseTransactionProxy">
-        <property name="proxyInterfaces">
-            <value>org.apache.jetspeed.page.PageManager</value>
-        </property>
-        <property name="target">
-            <ref bean="securePermissionsPageManagerImpl" />
-        </property>
-        <property name="transactionAttributes">
-            <props>
-              <prop key="getPage*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getLink*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getFolder*">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getContentPage">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getAll">PROPAGATION_SUPPORTS</prop>  
-              <prop key="getUserFolder">PROPAGATION_SUPPORTS</prop>  
-              <prop key="update*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePage">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeFolder">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removeLink">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="removePageSecurity">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>                            
-              <prop key="createUserHomePagesFromRoles">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="deepCopy*">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>
-              <prop key="addPages">PROPAGATION_REQUIRED,-org.apache.jetspeed.page.document.NodeException</prop>              
-              <prop key="folderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="pageExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="linkExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userFolderExists">PROPAGATION_SUPPORTS</prop>  
-              <prop key="userPageExists">PROPAGATION_SUPPORTS</prop>  
-            </props>
-        </property>
-    </bean>
-
-    <!-- Inject Page Manager Proxy into Page Manager -->
-    <bean id="injectPageManagerProxy" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
-        <property name="targetObject"><ref bean="securePermissionsPageManagerImpl"/></property>
-        <property name="targetMethod"><value>setPageManagerProxy</value></property>
-        <property name="arguments">
-            <list>
-                <ref bean="pageManager"/>
-            </list>
-        </property>
+        <constructor-arg index="2"><value>false</value></constructor-arg>
+        <!-- folder/page/link cache -->
+        <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+        <!-- folder/page/link path cache -->
+        <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
     </bean>
 
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/pom.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/pom.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/pom.xml Mon Dec  8 17:50:16 2008
@@ -105,6 +105,10 @@
                                         <path>assembly</path>
                                         <include>boot/datasource.xml</include>
                                     </resource>
+                                    <resource>
+                                        <path>db-ojb</path>
+                                        <include>ehcache.xml</include>
+                                    </resource>
                                 </resources>
                             </unpack>
                         </configuration>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/src/test/resources/cache-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/src/test/resources/cache-test.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/src/test/resources/cache-test.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal-site/src/test/resources/cache-test.xml Mon Dec  8 17:50:16 2008
@@ -18,11 +18,16 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <!-- Cache Manager -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+        <property name="test" value="true"/>
+    </bean>
+
     <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-        <meta key="j2:cat" value="default,cache" />
-        <!--  get it through the class path
-            <property name="configLocation" value="${applicationRoot}/WEB-INF/conf/ehcache.xml"/>
-        -->
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="configLocation" ref="cacheManagerConfig"/>
     </bean>
     
     <!-- Page File Cache -->
@@ -273,4 +278,27 @@
         </constructor-arg>
     </bean>
     
+    <!-- Page Manager Caches -->
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/pom.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/pom.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/pom.xml Mon Dec  8 17:50:16 2008
@@ -131,7 +131,7 @@
             <artifactId>mail</artifactId>
         </dependency>
         <dependency>
-            <groupId>ehcache</groupId>
+            <groupId>net.sf.ehcache</groupId>
             <artifactId>ehcache</artifactId>
         </dependency>
 

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/test/assembly/cache-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/test/assembly/cache-test.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/test/assembly/cache-test.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/test/assembly/cache-test.xml Mon Dec  8 17:50:16 2008
@@ -18,11 +18,16 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <!-- Cache Manager -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+        <property name="test" value="true"/>
+    </bean>
+
     <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-        <meta key="j2:cat" value="default,cache" />
-        <!--  get it through the class path
-            <property name="configLocation" value="${applicationRoot}/WEB-INF/conf/ehcache.xml"/>
-        -->
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="configLocation" ref="cacheManagerConfig"/>
     </bean>
     
     <!-- Page File Cache -->
@@ -273,4 +278,27 @@
         </constructor-arg>
     </bean>
     
+    <!-- Page Manager Caches -->
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-profiler/src/test/resources/cache-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-profiler/src/test/resources/cache-test.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-profiler/src/test/resources/cache-test.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-profiler/src/test/resources/cache-test.xml Mon Dec  8 17:50:16 2008
@@ -18,11 +18,16 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <!-- Cache Manager -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+        <property name="test" value="true"/>
+    </bean>
+
     <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-        <meta key="j2:cat" value="default,cache" />
-        <!--  get it through the class path
-            <property name="configLocation" value="${applicationRoot}/WEB-INF/conf/ehcache.xml"/>
-        -->
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="configLocation" ref="cacheManagerConfig"/>
     </bean>
     
     <!-- Page File Cache -->
@@ -273,4 +278,27 @@
         </constructor-arg>
     </bean>
     
+    <!-- Page Manager Caches -->
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/resources/cache-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/resources/cache-test.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/resources/cache-test.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-registry/src/test/resources/cache-test.xml Mon Dec  8 17:50:16 2008
@@ -18,11 +18,16 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <!-- Cache Manager -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+        <property name="test" value="true"/>
+    </bean>
+
     <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-        <meta key="j2:cat" value="default,cache" />
-        <!--  get it through the class path
-            <property name="configLocation" value="${applicationRoot}/WEB-INF/conf/ehcache.xml"/>
-        -->
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="configLocation" ref="cacheManagerConfig"/>
     </bean>
     
     <!-- Page File Cache -->
@@ -273,4 +278,27 @@
         </constructor-arg>
     </bean>
     
+    <!-- Page Manager Caches -->
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-security/src/test/resources/cache-test.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-security/src/test/resources/cache-test.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-security/src/test/resources/cache-test.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-security/src/test/resources/cache-test.xml Mon Dec  8 17:50:16 2008
@@ -18,11 +18,16 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <!-- Cache Manager -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+        <property name="test" value="true"/>
+    </bean>
+
     <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-        <meta key="j2:cat" value="default,cache" />
-        <!--  get it through the class path
-            <property name="configLocation" value="${applicationRoot}/WEB-INF/conf/ehcache.xml"/>
-        -->
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="configLocation" ref="cacheManagerConfig"/>
     </bean>
     
     <!-- Page File Cache -->
@@ -273,4 +278,27 @@
         </constructor-arg>
     </bean>
     
+    <!-- Page Manager Caches -->
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/etc/import/assembly/import-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/etc/import/assembly/import-page-manager.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/etc/import/assembly/import-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/etc/import/assembly/import-page-manager.xml Mon Dec  8 17:50:16 2008
@@ -25,14 +25,14 @@
         class="org.apache.jetspeed.page.impl.DatabasePageManager">
       <!-- OJB configuration file resource path -->
       <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
-      <!-- folder/page/link cache size, default=128, min=128 -->
-      <constructor-arg index="1"><value>128</value></constructor-arg>
-      <!-- folder/page/link cache expires seconds, default=150, infinite=0, min=30 -->
-      <constructor-arg index="2"><value>0</value></constructor-arg>
       <!-- permissions security enabled flag, default=false -->
-      <constructor-arg index="3"><value>false</value></constructor-arg>
+      <constructor-arg index="1"><value>false</value></constructor-arg>
       <!-- constraints security enabled flag, default=true -->
-      <constructor-arg index="4"><value>false</value></constructor-arg>
+      <constructor-arg index="2"><value>false</value></constructor-arg>
+      <!-- folder/page/link cache -->
+      <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+      <!-- folder/page/link path cache -->
+      <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
   </bean>
 
     <!-- Proxying -->

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/cache/JetspeedCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/cache/JetspeedCache.java?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/cache/JetspeedCache.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/cache/JetspeedCache.java Mon Dec  8 17:50:16 2008
@@ -136,4 +136,11 @@
      * @return the size of the cache
      */
     int getSize();
+    
+    /**
+     * Returns whether this cache is currently part of a distributed cache cluster.
+     * 
+     * @return distributed flag
+     */
+    boolean isDistributed();
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-api/src/main/java/org/apache/jetspeed/page/PageManager.java Mon Dec  8 17:50:16 2008
@@ -712,5 +712,13 @@
      * @param actions one or more portlet actions (view,edit,help,..)
      * @return
      */
-    public boolean checkConstraint(String securityConstraintName, String actions);    
+    public boolean checkConstraint(String securityConstraintName, String actions);
+    
+    /**
+     * Returns whether the page manager cache is currently part of a distributed
+     * cache cluster.
+     * 
+     * @return distributed flag
+     */
+    public boolean isDistributed();
 }

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-installer/etc/database/import/assembly/import-page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-installer/etc/database/import/assembly/import-page-manager.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-installer/etc/database/import/assembly/import-page-manager.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-installer/etc/database/import/assembly/import-page-manager.xml Mon Dec  8 17:50:16 2008
@@ -25,14 +25,14 @@
         class="org.apache.jetspeed.page.impl.DatabasePageManager">
       <!-- OJB configuration file resource path -->
       <constructor-arg index="0"><value>JETSPEED-INF/ojb/page-manager-repository.xml</value></constructor-arg>       
-      <!-- folder/page/link cache size, default=128, min=128 -->
-      <constructor-arg index="1"><value>128</value></constructor-arg>
-      <!-- folder/page/link cache expires seconds, default=150, infinite=0, min=30 -->
-      <constructor-arg index="2"><value>0</value></constructor-arg>
       <!-- permissions security enabled flag, default=false -->
-      <constructor-arg index="3"><value>false</value></constructor-arg>
+      <constructor-arg index="1"><value>false</value></constructor-arg>
       <!-- constraints security enabled flag, default=true -->
-      <constructor-arg index="4"><value>false</value></constructor-arg>
+      <constructor-arg index="2"><value>false</value></constructor-arg>
+      <!-- folder/page/link cache -->
+      <constructor-arg index="3"><ref bean="pageManagerOidCache"/></constructor-arg>
+      <!-- folder/page/link path cache -->
+      <constructor-arg index="4"><ref bean="pageManagerPathCache"/></constructor-arg>
   </bean>
 
     <!-- Proxying -->

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/cache.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/cache.xml?rev=724571&r1=724570&r2=724571&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/cache.xml (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-portal-resources/src/main/resources/assembly/cache.xml Mon Dec  8 17:50:16 2008
@@ -18,11 +18,15 @@
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
     
+    <!-- Cache Manager -->
+    <bean id="cacheManagerConfig" class="org.apache.jetspeed.cache.impl.EhCacheConfigResource">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="defaultConfigResource" value="ehcache.xml"/>
+    </bean>
+
     <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
-        <meta key="j2:cat" value="default,cache" />
-        <!--  get it through the class path
-            <property name="configLocation" value="${applicationRoot}/WEB-INF/conf/ehcache.xml"/>
-        -->
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="configLocation" ref="cacheManagerConfig"/>
     </bean>
     
     <!-- Page File Cache -->
@@ -273,4 +277,27 @@
         </constructor-arg>
     </bean>
     
+    <!-- Page Manager Caches -->
+    <bean id="ehPageManagerOidCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerOidCache"/>
+    </bean>
+    
+    <bean id="ehPageManagerPathCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
+        <meta key="j2:cat" value="default,cache"/>
+        <property name="cacheManager" ref="cacheManager"/>
+        <property name="cacheName" value="pageManagerPathCache"/>
+    </bean>
+    
+    <bean id="pageManagerOidCache" class="org.apache.jetspeed.cache.impl.EhCacheImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerOidCache"/></constructor-arg>
+    </bean>
+    
+    <bean id="pageManagerPathCache" class="org.apache.jetspeed.cache.impl.EhCacheDistributedImpl">
+        <meta key="j2:cat" value="default,cache"/>
+        <constructor-arg><ref bean="ehPageManagerPathCache"/></constructor-arg>
+    </bean>
+    
 </beans>



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


Mime
View raw message