directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nik...@apache.org
Subject svn commit: r450139 - in /directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio: ./ support/
Date Tue, 26 Sep 2006 18:24:18 GMT
Author: niklas
Date: Tue Sep 26 11:24:17 2006
New Revision: 450139

URL: http://svn.apache.org/viewvc?view=rev&rev=450139
Log:
Added setter for the defaultConfig property.

Modified:
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnector.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
    directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java?view=diff&rev=450139&r1=450138&r2=450139
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptor.java
Tue Sep 26 11:24:17 2006
@@ -23,6 +23,7 @@
 import org.apache.mina.common.support.DelegatedIoAcceptor;
 import org.apache.mina.transport.socket.nio.support.DatagramAcceptorDelegate;
 import org.apache.mina.util.NewThreadExecutor;
+
 import edu.emory.mathcs.backport.java.util.concurrent.Executor;
 
 /**
@@ -50,4 +51,15 @@
     {
         init( new DatagramAcceptorDelegate( this, executor ) );
     }
+    
+    /**
+     * Sets the config this acceptor will use by default.
+     * 
+     * @param defaultConfig the default config.
+     * @throws NullPointerException if the specified value is <code>null</code>.
+     */
+    public void setDefaultConfig( DatagramAcceptorConfig defaultConfig )
+    {
+        ( ( DatagramAcceptorDelegate ) delegate ).setDefaultConfig( defaultConfig );
+    }    
 }

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnector.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnector.java?view=diff&rev=450139&r1=450138&r2=450139
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnector.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnector.java
Tue Sep 26 11:24:17 2006
@@ -50,4 +50,15 @@
     {
         init( new DatagramConnectorDelegate( this, executor ) );
     }
+    
+    /**
+     * Sets the default config this connector should use.
+     * 
+     * @param defaultConfig the default config.
+     * @throws NullPointerException if the specified value is <code>null</code>.
+     */
+    public void setDefaultConfig( DatagramConnectorConfig defaultConfig )
+    {
+        ( ( DatagramConnectorDelegate ) delegate ).setDefaultConfig( defaultConfig );
+    }
 }

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java?view=diff&rev=450139&r1=450138&r2=450139
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
Tue Sep 26 11:24:17 2006
@@ -60,7 +60,7 @@
     private final Object lock = new Object();
     private final int id = nextId ++;
     private final String threadName = "SocketAcceptor-" + id;
-    private final IoServiceConfig defaultConfig = new SocketAcceptorConfig();
+    private SocketAcceptorConfig defaultConfig = new SocketAcceptorConfig();
     private final Map channels = new HashMap();
 
     private final Queue registerQueue = new Queue();
@@ -378,6 +378,21 @@
     public IoServiceConfig getDefaultConfig()
     {
         return defaultConfig;
+    }
+
+    /**
+     * Sets the config this acceptor will use by default.
+     * 
+     * @param defaultConfig the default config.
+     * @throws NullPointerException if the specified value is <code>null</code>.
+     */
+    public void setDefaultConfig( SocketAcceptorConfig defaultConfig )
+    {
+        if( defaultConfig == null )
+        {
+            throw new NullPointerException( "defaultConfig" );
+        }
+        this.defaultConfig = defaultConfig;
     }
 
     private void registerNew()

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java?view=diff&rev=450139&r1=450138&r2=450139
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnector.java
Tue Sep 26 11:24:17 2006
@@ -58,7 +58,7 @@
     private final Object lock = new Object();
     private final int id = nextId++;
     private final String threadName = "SocketConnector-" + id;
-    private final IoServiceConfig defaultConfig = new SocketConnectorConfig();
+    private SocketConnectorConfig defaultConfig = new SocketConnectorConfig();
     private final Queue connectQueue = new Queue();
     private final SocketIoProcessor[] ioProcessors;
     private final int processorCount;
@@ -231,6 +231,21 @@
         return defaultConfig;
     }
 
+    /**
+     * Sets the config this connector will use by default.
+     * 
+     * @param defaultConfig the default config.
+     * @throws NullPointerException if the specified value is <code>null</code>.
+     */
+    public void setDefaultConfig( SocketConnectorConfig defaultConfig )
+    {
+        if( defaultConfig == null )
+        {
+            throw new NullPointerException( "defaultConfig" );
+        }
+        this.defaultConfig = defaultConfig;
+    }
+    
     private synchronized void startupWorker() throws IOException
     {
         if( worker == null )

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java?view=diff&rev=450139&r1=450138&r2=450139
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramAcceptorDelegate.java
Tue Sep 26 11:24:17 2006
@@ -64,7 +64,7 @@
     private final Executor executor;
     private final int id = nextId ++ ;
     private Selector selector;
-    private final DatagramAcceptorConfig defaultConfig = new DatagramAcceptorConfig();
+    private DatagramAcceptorConfig defaultConfig = new DatagramAcceptorConfig();
     private final Map channels = new HashMap();
     private final Queue registerQueue = new Queue();
     private final Queue cancelQueue = new Queue();
@@ -280,6 +280,21 @@
     public IoServiceConfig getDefaultConfig()
     {
         return defaultConfig;
+    }
+    
+    /**
+     * Sets the config this acceptor will use by default.
+     * 
+     * @param defaultConfig the default config.
+     * @throws NullPointerException if the specified value is <code>null</code>.
+     */
+    public void setDefaultConfig( DatagramAcceptorConfig defaultConfig )
+    {
+        if( defaultConfig == null )
+        {
+            throw new NullPointerException( "defaultConfig" );
+        }
+        this.defaultConfig = defaultConfig;
     }
     
     private synchronized void startupWorker() throws IOException

Modified: directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
URL: http://svn.apache.org/viewvc/directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java?view=diff&rev=450139&r1=450138&r2=450139
==============================================================================
--- directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
(original)
+++ directory/trunks/mina/core/src/main/java/org/apache/mina/transport/socket/nio/support/DatagramConnectorDelegate.java
Tue Sep 26 11:24:17 2006
@@ -61,7 +61,7 @@
     private final Executor executor;
     private final int id = nextId ++ ;
     private Selector selector;
-    private final DatagramConnectorConfig defaultConfig = new DatagramConnectorConfig();
+    private DatagramConnectorConfig defaultConfig = new DatagramConnectorConfig();
     private final Queue registerQueue = new Queue();
     private final Queue cancelQueue = new Queue();
     private final Queue flushingSessions = new Queue();
@@ -194,7 +194,22 @@
     {
         return defaultConfig;
     }
-
+    
+    /**
+     * Sets the config this connector will use by default.
+     * 
+     * @param defaultConfig the default config.
+     * @throws NullPointerException if the specified value is <code>null</code>.
+     */
+    public void setDefaultConfig( DatagramConnectorConfig defaultConfig )
+    {
+        if( defaultConfig == null )
+        {
+            throw new NullPointerException( "defaultConfig" );
+        }
+        this.defaultConfig = defaultConfig;
+    }
+    
     private synchronized void startupWorker() throws IOException
     {
         if( worker == null )



Mime
View raw message