[jboss-cvs] JBossAS SVN: r107446 - in projects/cluster/ha-server-cache-ispn/trunk: src/main/java/org/jboss/ha/framework/server/ispn and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Aug 5 13:37:18 EDT 2010
Author: pferraro
Date: 2010-08-05 13:37:18 -0400 (Thu, 05 Aug 2010)
New Revision: 107446
Modified:
projects/cluster/ha-server-cache-ispn/trunk/pom.xml
projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java
Log:
Let DS implement ChannelSource.
Modified: projects/cluster/ha-server-cache-ispn/trunk/pom.xml
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/pom.xml 2010-08-05 17:02:14 UTC (rev 107445)
+++ projects/cluster/ha-server-cache-ispn/trunk/pom.xml 2010-08-05 17:37:18 UTC (rev 107446)
@@ -31,6 +31,7 @@
<properties>
<version.jboss.ha.server.cache.spi>3.0.0.Alpha3</version.jboss.ha.server.cache.spi>
+ <version.jboss.ha.server.core>1.0.0.Alpha2</version.jboss.ha.server.core>
<version.jboss.ha.server.ispn>1.0.0.Alpha1</version.jboss.ha.server.ispn>
<version.junit>4.8.1</version.junit>
<version.easymock>3.0</version.easymock>
@@ -47,6 +48,12 @@
<dependency>
<groupId>org.jboss.cluster</groupId>
+ <artifactId>jboss-ha-server-core</artifactId>
+ <version>${version.jboss.ha.server.core}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.cluster</groupId>
<artifactId>jboss-ha-server-ispn</artifactId>
<version>${version.jboss.ha.server.ispn}</version>
</dependency>
Modified: projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java
===================================================================
--- projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java 2010-08-05 17:02:14 UTC (rev 107445)
+++ projects/cluster/ha-server-cache-ispn/trunk/src/main/java/org/jboss/ha/framework/server/ispn/DistributedState.java 2010-08-05 17:37:18 UTC (rev 107446)
@@ -42,9 +42,12 @@
import org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent;
import org.infinispan.CacheException;
import org.infinispan.notifications.Listener;
+import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
import org.infinispan.util.SimpleImmutableEntry;
+import org.jboss.ha.core.framework.server.ChannelSource;
import org.jboss.ha.framework.server.spi.ManagedDistributedState;
import org.jboss.ha.ispn.CacheContainerRegistry;
+import org.jgroups.Channel;
/**
* This class manages distributed state across the cluster.
@@ -66,8 +69,7 @@
* @author Paul Ferraro
*/
@Listener
-public class DistributedState
- implements ManagedDistributedState
+public class DistributedState implements ManagedDistributedState, ChannelSource
{
private final ConcurrentMap<String, List<DSListener>> keyListeners = new ConcurrentHashMap<String, List<DSListener>>();
private final CacheContainerRegistry registry;
@@ -196,13 +198,21 @@
}
*/
+ /**
+ * {@inheritDoc}
+ * @see org.jboss.ha.core.framework.server.ChannelSource#getChannel()
+ */
+ @Override
+ public Channel getChannel()
+ {
+ if (this.cache == null) return null;
+
+ JGroupsTransport transport = (JGroupsTransport) this.cache.getAdvancedCache().getRpcManager().getTransport();
+
+ return transport.getChannel();
+ }
+
// DistributedState implementation ----------------------------------------------
- /*
- * (non-Javadoc)
- *
- * @see org.jboss.ha.framework.interfaces.DistributedState#set(java.lang.String,
- * java.io.Serializable, java.io.Serializable)
- */
@Override
public void set(String category, Serializable key, Serializable value) throws Exception
{
More information about the jboss-cvs-commits
mailing list