[infinispan-commits] Infinispan SVN: r426 - in trunk/core/src: main/java/org/infinispan/config/parsing and 2 other directories.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed Jun 10 13:19:57 EDT 2009


Author: manik.surtani at jboss.com
Date: 2009-06-10 13:19:57 -0400 (Wed, 10 Jun 2009)
New Revision: 426

Modified:
   trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
   trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java
   trunk/core/src/main/java/org/infinispan/factories/NamedExecutorsFactory.java
   trunk/core/src/test/java/org/infinispan/config/parsing/GlobalConfigurationParserTest.java
   trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
Log:
renamed executor

Modified: trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java	2009-06-10 16:22:19 UTC (rev 425)
+++ trunk/core/src/main/java/org/infinispan/config/GlobalConfiguration.java	2009-06-10 17:19:57 UTC (rev 426)
@@ -34,8 +34,8 @@
 
    private String asyncListenerExecutorFactoryClass = DefaultExecutorFactory.class.getName();
    private TypedProperties asyncListenerExecutorProperties = EMPTY_PROPERTIES;
-   private String asyncSerializationExecutorFactoryClass = DefaultExecutorFactory.class.getName();
-   private TypedProperties asyncSerializationExecutorProperties = EMPTY_PROPERTIES;
+   private String asyncTransportExecutorFactoryClass = DefaultExecutorFactory.class.getName();
+   private TypedProperties asyncTransportExecutorProperties = EMPTY_PROPERTIES;
    private String evictionScheduledExecutorFactoryClass = DefaultScheduledExecutorFactory.class.getName();
    private TypedProperties evictionScheduledExecutorProperties = EMPTY_PROPERTIES;
    private String replicationQueueScheduledExecutorFactoryClass = DefaultScheduledExecutorFactory.class.getName();
@@ -135,13 +135,13 @@
       this.asyncListenerExecutorFactoryClass = asyncListenerExecutorFactoryClass;
    }
 
-   public String getAsyncSerializationExecutorFactoryClass() {
-      return asyncSerializationExecutorFactoryClass;
+   public String getAsyncTransportExecutorFactoryClass() {
+      return asyncTransportExecutorFactoryClass;
    }
 
-   public void setAsyncSerializationExecutorFactoryClass(String asyncSerializationExecutorFactoryClass) {
-      testImmutability("asyncSerializationExecutorFactoryClass");
-      this.asyncSerializationExecutorFactoryClass = asyncSerializationExecutorFactoryClass;
+   public void setAsyncTransportExecutorFactoryClass(String asyncTransportExecutorFactoryClass) {
+      testImmutability("asyncTransportExecutorFactoryClass");
+      this.asyncTransportExecutorFactoryClass = asyncTransportExecutorFactoryClass;
    }
 
    public String getEvictionScheduledExecutorFactoryClass() {
@@ -246,18 +246,18 @@
       this.asyncListenerExecutorProperties = toTypedProperties(asyncListenerExecutorPropertiesString);
    }
 
-   public Properties getAsyncSerializationExecutorProperties() {
-      return asyncSerializationExecutorProperties;
+   public Properties getAsyncTransportExecutorProperties() {
+      return asyncTransportExecutorProperties;
    }
 
-   public void setAsyncSerializationExecutorProperties(Properties asyncSerializationExecutorProperties) {
-      testImmutability("asyncSerializationExecutorProperties");
-      this.asyncSerializationExecutorProperties = toTypedProperties(asyncSerializationExecutorProperties);
+   public void setAsyncTransportExecutorProperties(Properties asyncTransportExecutorProperties) {
+      testImmutability("asyncTransportExecutorProperties");
+      this.asyncTransportExecutorProperties = toTypedProperties(asyncTransportExecutorProperties);
    }
 
-   public void setAsyncSerializationExecutorProperties(String asyncSerializationExecutorPropertiesString) {
-      testImmutability("asyncSerializationExecutorProperties");
-      this.asyncSerializationExecutorProperties = toTypedProperties(asyncSerializationExecutorPropertiesString);
+   public void setAsyncTransportExecutorProperties(String asyncSerializationExecutorPropertiesString) {
+      testImmutability("asyncTransportExecutorProperties");
+      this.asyncTransportExecutorProperties = toTypedProperties(asyncSerializationExecutorPropertiesString);
    }
 
    public Properties getEvictionScheduledExecutorProperties() {
@@ -327,9 +327,9 @@
          return false;
       if (asyncListenerExecutorProperties != null ? !asyncListenerExecutorProperties.equals(that.asyncListenerExecutorProperties) : that.asyncListenerExecutorProperties != null)
          return false;
-      if (asyncSerializationExecutorFactoryClass != null ? !asyncSerializationExecutorFactoryClass.equals(that.asyncSerializationExecutorFactoryClass) : that.asyncSerializationExecutorFactoryClass != null)
+      if (asyncTransportExecutorFactoryClass != null ? !asyncTransportExecutorFactoryClass.equals(that.asyncTransportExecutorFactoryClass) : that.asyncTransportExecutorFactoryClass != null)
          return false;
-      if (asyncSerializationExecutorProperties != null ? !asyncSerializationExecutorProperties.equals(that.asyncSerializationExecutorProperties) : that.asyncSerializationExecutorProperties != null)
+      if (asyncTransportExecutorProperties != null ? !asyncTransportExecutorProperties.equals(that.asyncTransportExecutorProperties) : that.asyncTransportExecutorProperties != null)
          return false;
       if (clusterName != null ? !clusterName.equals(that.clusterName) : that.clusterName != null) return false;
       if (defaultConfiguration != null ? !defaultConfiguration.equals(that.defaultConfiguration) : that.defaultConfiguration != null)
@@ -358,8 +358,8 @@
    public int hashCode() {
       int result = asyncListenerExecutorFactoryClass != null ? asyncListenerExecutorFactoryClass.hashCode() : 0;
       result = 31 * result + (asyncListenerExecutorProperties != null ? asyncListenerExecutorProperties.hashCode() : 0);
-      result = 31 * result + (asyncSerializationExecutorFactoryClass != null ? asyncSerializationExecutorFactoryClass.hashCode() : 0);
-      result = 31 * result + (asyncSerializationExecutorProperties != null ? asyncSerializationExecutorProperties.hashCode() : 0);
+      result = 31 * result + (asyncTransportExecutorFactoryClass != null ? asyncTransportExecutorFactoryClass.hashCode() : 0);
+      result = 31 * result + (asyncTransportExecutorProperties != null ? asyncTransportExecutorProperties.hashCode() : 0);
       result = 31 * result + (evictionScheduledExecutorFactoryClass != null ? evictionScheduledExecutorFactoryClass.hashCode() : 0);
       result = 31 * result + (evictionScheduledExecutorProperties != null ? evictionScheduledExecutorProperties.hashCode() : 0);
       result = 31 * result + (replicationQueueScheduledExecutorFactoryClass != null ? replicationQueueScheduledExecutorFactoryClass.hashCode() : 0);
@@ -395,6 +395,9 @@
       GlobalConfiguration gc = new GlobalConfiguration();
       gc.setTransportClass(JGroupsTransport.class.getName());
       gc.setTransportProperties((Properties) null);
+      Properties p = new Properties();
+      p.setProperty("threadNamePrefix", "asyncTransportThread");
+      gc.setAsyncTransportExecutorProperties(p);
       return gc;
    }
 

Modified: trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java	2009-06-10 16:22:19 UTC (rev 425)
+++ trunk/core/src/main/java/org/infinispan/config/parsing/XmlConfigurationParserImpl.java	2009-06-10 17:19:57 UTC (rev 426)
@@ -135,7 +135,7 @@
          if (globalElement != null) {
             globalElement.normalize();
             configureAsyncListenerExecutor(getSingleElementInCoreNS("asyncListenerExecutor", globalElement), gc);
-            configureAsyncSerializationExecutor(getSingleElementInCoreNS("asyncTransportExecutor", globalElement), gc);
+            configureAsyncTransportExecutor(getSingleElementInCoreNS("asyncTransportExecutor", globalElement), gc);
             configureEvictionScheduledExecutor(getSingleElementInCoreNS("evictionScheduledExecutor", globalElement), gc);
             configureReplicationQueueScheduledExecutor(getSingleElementInCoreNS("replicationQueueScheduledExecutor", globalElement), gc);
             configureTransport(getSingleElementInCoreNS("transport", globalElement), gc);
@@ -416,12 +416,12 @@
       }
    }
 
-   void configureAsyncSerializationExecutor(Element e, GlobalConfiguration gc) {
+   void configureAsyncTransportExecutor(Element e, GlobalConfiguration gc) {
       if (e != null) {
          String tmp = getAttributeValue(e, "factory");
-         if (existsAttribute(tmp)) gc.setAsyncSerializationExecutorFactoryClass(tmp);
+         if (existsAttribute(tmp)) gc.setAsyncTransportExecutorFactoryClass(tmp);
          Properties p = XmlConfigHelper.extractProperties(e);
-         if (p != null) gc.setAsyncSerializationExecutorProperties(p);
+         if (p != null) gc.setAsyncTransportExecutorProperties(p);
       }
    }
 

Modified: trunk/core/src/main/java/org/infinispan/factories/NamedExecutorsFactory.java
===================================================================
--- trunk/core/src/main/java/org/infinispan/factories/NamedExecutorsFactory.java	2009-06-10 16:22:19 UTC (rev 425)
+++ trunk/core/src/main/java/org/infinispan/factories/NamedExecutorsFactory.java	2009-06-10 17:19:57 UTC (rev 426)
@@ -27,8 +27,8 @@
             return (T) buildAndConfigureExecutorService(globalConfiguration.getAsyncListenerExecutorFactoryClass(),
                                                         globalConfiguration.getAsyncListenerExecutorProperties());
          } else if (componentName.equals(KnownComponentNames.ASYNC_TRANSPORT_EXECUTOR)) {
-            return (T) buildAndConfigureExecutorService(globalConfiguration.getAsyncSerializationExecutorFactoryClass(),
-                                                        globalConfiguration.getAsyncSerializationExecutorProperties());
+            return (T) buildAndConfigureExecutorService(globalConfiguration.getAsyncTransportExecutorFactoryClass(),
+                                                        globalConfiguration.getAsyncTransportExecutorProperties());
          } else if (componentName.equals(KnownComponentNames.EVICTION_SCHEDULED_EXECUTOR)) {
             return (T) buildAndConfigureScheduledExecutorService(globalConfiguration.getEvictionScheduledExecutorFactoryClass(),
                                                                  globalConfiguration.getEvictionScheduledExecutorProperties());

Modified: trunk/core/src/test/java/org/infinispan/config/parsing/GlobalConfigurationParserTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/parsing/GlobalConfigurationParserTest.java	2009-06-10 16:22:19 UTC (rev 425)
+++ trunk/core/src/test/java/org/infinispan/config/parsing/GlobalConfigurationParserTest.java	2009-06-10 17:19:57 UTC (rev 426)
@@ -124,9 +124,9 @@
       GlobalConfiguration gc = new GlobalConfiguration();
       parser.configureAsyncSerializationExecutor(e, gc);
 
-      assert gc.getAsyncSerializationExecutorFactoryClass().equals("com.mycompany.Factory");
-      assert gc.getAsyncSerializationExecutorProperties().size() == 1;
-      assert gc.getAsyncSerializationExecutorProperties().get("maxThreads").equals("5");
+      assert gc.getAsyncTransportExecutorFactoryClass().equals("com.mycompany.Factory");
+      assert gc.getAsyncTransportExecutorProperties().size() == 1;
+      assert gc.getAsyncTransportExecutorProperties().get("maxThreads").equals("5");
    }
 
    public void testEvictionScheduledExecutor() throws Exception {
@@ -179,8 +179,8 @@
       GlobalConfiguration gc = new GlobalConfiguration();
       parser.configureAsyncSerializationExecutor(e, gc);
 
-      assert gc.getAsyncSerializationExecutorFactoryClass().equals(DefaultExecutorFactory.class.getName());
-      assert gc.getAsyncSerializationExecutorProperties().size() == 0;
+      assert gc.getAsyncTransportExecutorFactoryClass().equals(DefaultExecutorFactory.class.getName());
+      assert gc.getAsyncTransportExecutorProperties().size() == 0;
    }
 
    public void testEvictionScheduledExecutorDefaults() throws Exception {

Modified: trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java
===================================================================
--- trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java	2009-06-10 16:22:19 UTC (rev 425)
+++ trunk/core/src/test/java/org/infinispan/config/parsing/XmlFileParsingTest.java	2009-06-10 17:19:57 UTC (rev 426)
@@ -23,9 +23,9 @@
       assert gc.getAsyncListenerExecutorProperties().getProperty("maxThreads").equals("5");
       assert gc.getAsyncListenerExecutorProperties().getProperty("threadNamePrefix").equals("AsyncListenerThread");
 
-      assert gc.getAsyncSerializationExecutorFactoryClass().equals("org.infinispan.executors.DefaultExecutorFactory");
-      assert gc.getAsyncSerializationExecutorProperties().getProperty("maxThreads").equals("25");
-      assert gc.getAsyncSerializationExecutorProperties().getProperty("threadNamePrefix").equals("AsyncSerializationThread");
+      assert gc.getAsyncTransportExecutorFactoryClass().equals("org.infinispan.executors.DefaultExecutorFactory");
+      assert gc.getAsyncTransportExecutorProperties().getProperty("maxThreads").equals("25");
+      assert gc.getAsyncTransportExecutorProperties().getProperty("threadNamePrefix").equals("AsyncSerializationThread");
 
       assert gc.getEvictionScheduledExecutorFactoryClass().equals("org.infinispan.executors.DefaultScheduledExecutorFactory");
       assert gc.getEvictionScheduledExecutorProperties().getProperty("threadNamePrefix").equals("EvictionThread");




More information about the infinispan-commits mailing list