directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r385266 - in /directory/trunks/mina/core/src/main/java/org/apache/mina/common: IoServiceConfig.java support/BaseIoServiceConfig.java
Date Sun, 12 Mar 2006 09:37:39 GMT
Author: trustin
Date: Sun Mar 12 01:37:38 2006
New Revision: 385266

URL: http://svn.apache.org/viewcvs?rev=385266&view=rev
Log:
Changed the contract of IoServiceConfig.setThreadModel()


Modified:
    directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoServiceConfig.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/BaseIoServiceConfig.java

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoServiceConfig.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoServiceConfig.java?rev=385266&r1=385265&r2=385266&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoServiceConfig.java (original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/IoServiceConfig.java Sun
Mar 12 01:37:38 2006
@@ -62,11 +62,14 @@
     
     /**
      * Returns the default {@link ThreadModel} of the {@link IoService}.
+     * The default value is <tt>new {@link PooledThreadModel}()</tt>.
      */
     ThreadModel getThreadModel();
     
     /**
      * Sets the default {@link ThreadModel} of the {@link IoService}.
+     * If you specify <tt>null</tt>, this property will be set to the
+     * default value.  The default value is <tt>new {@link PooledThreadModel}()</tt>.
      */
     void setThreadModel( ThreadModel threadModel );
     

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/BaseIoServiceConfig.java
URL: http://svn.apache.org/viewcvs/directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/BaseIoServiceConfig.java?rev=385266&r1=385265&r2=385266&view=diff
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/BaseIoServiceConfig.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/common/support/BaseIoServiceConfig.java
Sun Mar 12 01:37:38 2006
@@ -39,10 +39,11 @@
      */
     private IoFilterChainBuilder filterChainBuilder = new DefaultIoFilterChainBuilder();
     
+    private final ThreadModel defaultThreadModel = new PooledThreadModel();
     /**
      * Current thread model.
      */
-    private ThreadModel threadModel = new PooledThreadModel();
+    private ThreadModel threadModel = defaultThreadModel;
 
     public BaseIoServiceConfig()
     {
@@ -85,7 +86,9 @@
     {
         if( threadModel == null )
         {
-            throw new NullPointerException( "threadModel" );
+            // We reuse the previous default model to prevent too much
+            // daemon threads are created.
+            threadModel = defaultThreadModel;
         }
         this.threadModel = threadModel;
     }



Mime
View raw message