Author: chris.laprun(a)jboss.com
Date: 2009-12-18 10:07:21 -0500 (Fri, 18 Dec 2009)
New Revision: 1071
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
Log:
- Version of JCRPersister that seems to work. Might be less efficient because we need to
retrieve the container and session
provider at instantiation of the SessionLifeCycle instead of doing it just once when the
class is loaded but this seems
to work and it seems that there was some classloading-related issues going preventing
the proper behavior.
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-12-18
14:38:58 UTC (rev 1070)
+++
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-12-18
15:07:21 UTC (rev 1071)
@@ -84,33 +84,23 @@
public static class WSRPSessionLifeCycle implements SessionLifeCycle
{
- private static boolean initialized = false;
- private static ManageableRepository repository;
- private static SessionProvider provider;
+ private ManageableRepository repository;
+ private SessionProvider provider;
public WSRPSessionLifeCycle()
{
- init();
- }
-
- private static void init()
- {
- if (!initialized)
+ try
{
- try
- {
- ExoContainer container = ExoContainerContext.getCurrentContainer();
- RepositoryService repoService =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
- repository = repoService.getRepository(REPOSITORY_NAME);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
-
- provider = SessionProvider.createSystemProvider();
- initialized = true;
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ RepositoryService repoService =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ repository = repoService.getRepository(REPOSITORY_NAME);
}
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ provider = SessionProvider.createSystemProvider();
}
public Session login() throws RepositoryException
Show replies by date