I'm currently facing some problems with the non thread safety of the PageManager. My portal is creating a huge amount of folders and pages in one run with the PageManager API. The psmls are always created correctly, but the menu sometimes show the wrong values. They get sometimes not even refreshed by the FileCacheScanner, only restarting tomcat or rebuilding the folders and pages in another run helps.
E.g. one excerpt from my code:
pm.deepCopyFolder( navigationFolder, path, null );
Folder newFolder = pm.getFolder( path );
// set folder titles
newFolder.setTitle( node.getName() );
newFolder.setShortTitle( node.getName() );
// folder menu definitions
pm.updateFolder( newFolder );
Sometimes the resulting folder still shows the old title (from the source folder) and not the subsequently set new title.
I'm also seeing some ConcurrentModificationException in jetspeed.log:
2006-03-30 01:03:16,151 [Thread-3] DEBUG org.apache.jetspeed.portalsite.impl.PortalSiteSessionContextImpl - Page manager update event, (node=/courses/WS0506/folder.metadata): set session context state stale
2006-03-30 01:03:16,151 [Thread-3] ERROR org.apache.jetspeed.cache.file.FileCache - FileCache Scanner: Error in iteration...
2006-03-30 01:03:17,173 [Thread-3] DEBUG org.apache.jetspeed.page.document.psml.CastorFileSystemDocumentHandler - Entry is refreshing: folder.metadata
The ConcurrentModificationException could possibly be solved by using a cache Map with copy on write (COW) semantics as available in Java 1.5, but I still don't really overlook the implementation of the PageManager
Randy, is there a solution in sight?
Thanks in advance,
P.S. the PageManager does a good job, esp. the declarative menus