Author: chris.laprun(a)jboss.com
Date: 2011-10-21 12:01:26 -0400 (Fri, 21 Oct 2011)
New Revision: 7833
Added:
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedConsumerCache.java
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedSessionRegistry.java
Modified:
portal/trunk/examples/portlets/jsfhellouser/pom.xml
portal/trunk/pom.xml
Log:
- Updated to use PC 2.3.0-Beta08 and WSRP 2.1.0-Beta08.
Modified: portal/trunk/examples/portlets/jsfhellouser/pom.xml
===================================================================
--- portal/trunk/examples/portlets/jsfhellouser/pom.xml 2011-10-21 15:49:33 UTC (rev
7832)
+++ portal/trunk/examples/portlets/jsfhellouser/pom.xml 2011-10-21 16:01:26 UTC (rev
7833)
@@ -41,13 +41,13 @@
<dependency>
<groupId>org.jboss.portletbridge</groupId>
<artifactId>portletbridge-api</artifactId>
- <version>2.0.0.FINAL</version>
+ <version>2.2.0-CR02-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jboss.portletbridge</groupId>
<artifactId>portletbridge-impl</artifactId>
- <version>2.0.0.FINAL</version>
+ <version>2.2.0-CR02-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2011-10-21 15:49:33 UTC (rev 7832)
+++ portal/trunk/pom.xml 2011-10-21 16:01:26 UTC (rev 7833)
@@ -45,9 +45,9 @@
<nl.captcha.simplecaptcha.version>1.1.1-GA-Patch01</nl.captcha.simplecaptcha.version>
<org.gatein.common.version>2.0.4-GA</org.gatein.common.version>
<org.gatein.wci.version>2.1.0-GA</org.gatein.wci.version>
- <org.gatein.pc.version>2.3.0-Beta06</org.gatein.pc.version>
+ <org.gatein.pc.version>2.3.0-Beta08</org.gatein.pc.version>
<org.picketlink.idm>1.3.0.Alpha09</org.picketlink.idm>
- <org.gatein.wsrp.version>2.1.0-Beta07</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>2.1.0-Beta08</org.gatein.wsrp.version>
<org.gatein.mop.version>1.1.0-Beta06</org.gatein.mop.version>
<org.gatein.mgmt.version>1.0.0-Beta05</org.gatein.mgmt.version>
<org.slf4j.version>1.5.8</org.slf4j.version>
Added:
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedConsumerCache.java
===================================================================
---
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedConsumerCache.java
(rev 0)
+++
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedConsumerCache.java 2011-10-21
16:01:26 UTC (rev 7833)
@@ -0,0 +1,105 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.integration.wsrp;
+
+import org.exoplatform.services.cache.CacheService;
+import org.exoplatform.services.cache.ExoCache;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.registry.ConsumerCache;
+
+import java.util.Collection;
+import java.util.Collections;
+
+/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
+public class DistributedConsumerCache implements ConsumerCache
+{
+ private static final Logger log =
LoggerFactory.getLogger(DistributedConsumerCache.class);
+
+ private ExoCache<String, WSRPConsumer> cache;
+ private boolean invalidated;
+
+ public DistributedConsumerCache(CacheService cacheService)
+ {
+ this.cache =
cacheService.getCacheInstance(DistributedConsumerCache.class.getSimpleName());
+ }
+
+ public Collection<WSRPConsumer> getConsumers()
+ {
+ try
+ {
+ return (Collection<WSRPConsumer>)cache.getCachedObjects();
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ return Collections.emptyList();
+ }
+ }
+
+ public WSRPConsumer getConsumer(String id)
+ {
+ return cache.get(id);
+ }
+
+ public WSRPConsumer removeConsumer(String id)
+ {
+ return cache.remove(id);
+ }
+
+ public void putConsumer(String id, WSRPConsumer consumer)
+ {
+ cache.put(id, consumer);
+ }
+
+ public void clear()
+ {
+ cache.clearCache();
+ }
+
+ public boolean isInvalidated()
+ {
+ return invalidated;
+ }
+
+ public void setInvalidated(boolean invalidated)
+ {
+ this.invalidated = invalidated;
+ }
+
+ public long getLastModified()
+ {
+ return 0;
+ }
+
+ public void initFromStorage()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void markAsModifiedNow()
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Added:
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedSessionRegistry.java
===================================================================
---
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedSessionRegistry.java
(rev 0)
+++
portal/trunk/wsrp-integration/extension-component/src/main/java/org/gatein/integration/wsrp/DistributedSessionRegistry.java 2011-10-21
16:01:26 UTC (rev 7833)
@@ -0,0 +1,72 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.integration.wsrp;
+
+import org.exoplatform.services.cache.ExoCache;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.handlers.ProducerSessionInformation;
+import org.gatein.wsrp.consumer.handlers.session.SessionRegistry;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
+public class DistributedSessionRegistry implements SessionRegistry
+{
+ private static final Logger log =
LoggerFactory.getLogger(DistributedConsumerCache.class);
+
+ private ExoCache<String, ProducerSessionInformation> cache;
+
+ public Set<ProducerSessionInformation> getAll()
+ {
+ try
+ {
+ return new HashSet<ProducerSessionInformation>
+ (cache.getCachedObjects());
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ return Collections.emptySet();
+ }
+ }
+
+ public ProducerSessionInformation get(String sessionId)
+ {
+ return cache.get(sessionId);
+ }
+
+ public ProducerSessionInformation remove(String sessionId)
+ {
+ return cache.remove(sessionId);
+ }
+
+ public void put(String sessionId, ProducerSessionInformation sessionInformation)
+ {
+ cache.put(sessionId, sessionInformation);
+ }
+}