[exo-jcr-commits] exo-jcr SVN: r1004 - in kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3: src/main/java/org/exoplatform/services/cache/impl/jboss and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 11 07:49:41 EST 2009


Author: mstruk
Date: 2009-12-11 07:49:41 -0500 (Fri, 11 Dec 2009)
New Revision: 1004

Modified:
   kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
   kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java
   kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
Log:
Merged trunk changes up to r1003

Modified: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml	2009-12-11 12:41:36 UTC (rev 1003)
+++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/pom.xml	2009-12-11 12:49:41 UTC (rev 1004)
@@ -1,36 +1,64 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-   <modelVersion>4.0.0</modelVersion>
+	<modelVersion>4.0.0</modelVersion>
 
-   <parent>
-      <groupId>org.exoplatform.kernel</groupId>
-      <artifactId>kernel-parent</artifactId>
-      <version>2.2.0-Beta05-SNAPSHOT</version>
-   </parent>
+	<parent>
+		<groupId>org.exoplatform.kernel</groupId>
+		<artifactId>kernel-parent</artifactId>
+		<version>2.2.0-Beta05-SNAPSHOT</version>
+	</parent>
 
-   <artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
-   <name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
-   <description>JBoss Cache Implementation for the Cache Service</description>
+	<artifactId>exo.kernel.component.ext.cache.impl.jboss.v3</artifactId>
+	<name>eXo Kernel :: Cache Extension :: JBoss Cache Implementation</name>
+	<description>JBoss Cache Implementation for the Cache Service</description>
 
-   <dependencies>
-      <dependency>
-         <groupId>org.exoplatform.tool</groupId>
-         <artifactId>exo.tool.framework.junit</artifactId>
-      </dependency>      
-      <dependency>
-         <groupId>org.exoplatform.kernel</groupId>
-         <artifactId>exo.kernel.commons</artifactId>
-      </dependency>   
-      <dependency>
-         <groupId>org.exoplatform.kernel</groupId>
-         <artifactId>exo.kernel.container</artifactId>
-      </dependency>         
-      <dependency>
-         <groupId>org.exoplatform.kernel</groupId>
-         <artifactId>exo.kernel.component.cache</artifactId>
-      </dependency>
-      <dependency>
-         <groupId>org.jboss.cache</groupId>
-         <artifactId>jbosscache-core</artifactId>
-       </dependency>
-   </dependencies>
+	<dependencies>
+		<dependency>
+			<groupId>org.exoplatform.tool</groupId>
+			<artifactId>exo.tool.framework.junit</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.exoplatform.kernel</groupId>
+			<artifactId>exo.kernel.commons</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.exoplatform.kernel</groupId>
+			<artifactId>exo.kernel.container</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.exoplatform.kernel</groupId>
+			<artifactId>exo.kernel.component.cache</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>org.jboss.cache</groupId>
+			<artifactId>jbosscache-core</artifactId>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<configuration>
+					<systemProperties>
+						<!-- We add this system property due to some incompatibility between IPv6 and 
+						some JVM of Linux distributions such as Ubuntu and Fedora-->
+						<property>
+							<name>java.net.preferIPv4Stack</name>
+							<value>true</value>
+						</property>
+						<!-- Avoid the firewall -->
+						<property>
+							<name>bind.address</name>
+							<value>127.0.0.1</value>
+						</property>
+						<property>
+							<name>jgroups.stack</name>
+							<value>udp</value>
+						</property>
+
+					</systemProperties>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>

Modified: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java	2009-12-11 12:41:36 UTC (rev 1003)
+++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/main/java/org/exoplatform/services/cache/impl/jboss/ExoCacheFactoryImpl.java	2009-12-11 12:49:41 UTC (rev 1004)
@@ -18,12 +18,6 @@
  */
 package org.exoplatform.services.cache.impl.jboss;
 
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
 import org.exoplatform.container.configuration.ConfigurationManager;
 import org.exoplatform.container.xml.InitParams;
 import org.exoplatform.container.xml.ValueParam;
@@ -42,6 +36,12 @@
 import org.jboss.cache.config.EvictionRegionConfig;
 import org.jboss.cache.config.Configuration.CacheMode;
 
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
 /**
  * This class is the JBoss Cache implementation of the {@link org.exoplatform.services.cache.ExoCacheFactory}
  * Created by The eXo Platform SAS
@@ -112,13 +112,13 @@
     * 2. If no specific location has been defined, we use the default configuration which is
     * "${CACHE_CONFIG_TEMPLATE_KEY}"
     */
-   public ExoCache createCache(ExoCacheConfig config) throws ExoCacheInitException
+   public ExoCache<Serializable, Object> createCache(ExoCacheConfig config) throws ExoCacheInitException
    {
       final String region = config.getName();
       final String customConfig = mappingCacheNameConfig.get(region);
       final Cache<Serializable, Object> cache;
       final CacheFactory<Serializable, Object> factory = new DefaultCacheFactory<Serializable, Object>();
-      final ExoCache eXoCache;
+      final ExoCache<Serializable, Object> eXoCache;
       try
       {
          if (customConfig != null)
@@ -230,7 +230,13 @@
    {
       final Configuration config = cache.getConfiguration();
       // Reset the eviction policies 
-      final EvictionConfig evictionConfig = config.getEvictionConfig();
+      EvictionConfig evictionConfig = config.getEvictionConfig();
+      if (evictionConfig == null)
+      {
+         // If not eviction config exists, we create an empty one
+         evictionConfig = new EvictionConfig();
+         config.setEvictionConfig(evictionConfig);
+      }
       evictionConfig.setEvictionRegionConfigs(new LinkedList<EvictionRegionConfig>());
       // Rename the cluster name
       String clusterName = config.getClusterName();

Modified: kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java
===================================================================
--- kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java	2009-12-11 12:41:36 UTC (rev 1003)
+++ kernel/branches/mc-int-branch/exo.kernel.component.ext.cache.impl.jboss.v3/src/test/java/org/exoplatform/services/cache/impl/jboss/TestAbstractExoCache.java	2009-12-11 12:49:41 UTC (rev 1004)
@@ -232,6 +232,7 @@
    @SuppressWarnings("unchecked")
    public void testDistributedCache() throws Exception
    {
+      System.out.println("WARNING: For Linux distributions the following JVM parameter must be set to true, java.net.preferIPv4Stack = " + System.getProperty("java.net.preferIPv4Stack"));
       ExoCacheConfig config = new ExoCacheConfig();
       config.setName("MyCacheDistributed");
       config.setMaxSize(5);
@@ -404,7 +405,7 @@
       long time = System.currentTimeMillis();
       final ExoCache<Serializable, Object> cache = service.getCacheInstance("test-multi-threading");
       final int totalElement = 100;
-      final int totalTimes = 100;
+      final int totalTimes = 20;
       int reader = 20;
       int writer = 10;
       int remover = 5;



More information about the exo-jcr-commits mailing list