directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pro...@apache.org
Subject svn commit: r471549 - in /directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio: DatagramAcceptorConfig.java DatagramConnectorConfig.java SocketAcceptor.java SocketAcceptorConfig.java SocketConnectorConfig.java
Date Sun, 05 Nov 2006 22:42:03 GMT
Author: proyal
Date: Sun Nov  5 14:42:02 2006
New Revision: 471549

URL: http://svn.apache.org/viewvc?view=rev&rev=471549
Log:
add some covariant return types to help avoid casting

Modified:
    directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptorConfig.java
    directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnectorConfig.java
    directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
    directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptorConfig.java
    directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnectorConfig.java

Modified: directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptorConfig.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptorConfig.java?view=diff&rev=471549&r1=471548&r2=471549
==============================================================================
--- directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptorConfig.java
(original)
+++ directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramAcceptorConfig.java
Sun Nov  5 14:42:02 2006
@@ -6,23 +6,22 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.mina.transport.socket.nio;
 
 
 import org.apache.mina.common.ExpiringSessionRecycler;
 import org.apache.mina.common.IoAcceptorConfig;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.IoSessionRecycler;
 import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.common.support.BaseIoAcceptorConfig;
@@ -37,7 +36,7 @@
 public class DatagramAcceptorConfig extends BaseIoAcceptorConfig implements DatagramServiceConfig
 {
     private static final IoSessionRecycler DEFAULT_RECYCLER = new ExpiringSessionRecycler();
-    
+
     /**
      * Current session recycler
      */
@@ -47,7 +46,7 @@
 
     /**
      * Creates a new instance.
-     * 
+     *
      * @throws RuntimeIOException if failed to get the default configuration
      */
     public DatagramAcceptorConfig()
@@ -55,11 +54,11 @@
         super();
     }
 
-    public IoSessionConfig getSessionConfig()
+    public DatagramSessionConfig getSessionConfig()
     {
         return sessionConfig;
     }
-    
+
     public IoSessionRecycler getSessionRecycler()
     {
         return sessionRecycler;

Modified: directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnectorConfig.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnectorConfig.java?view=diff&rev=471549&r1=471548&r2=471549
==============================================================================
--- directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnectorConfig.java
(original)
+++ directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/DatagramConnectorConfig.java
Sun Nov  5 14:42:02 2006
@@ -6,22 +6,21 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.mina.transport.socket.nio;
 
 import org.apache.mina.common.ExpiringSessionRecycler;
 import org.apache.mina.common.IoConnectorConfig;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.IoSessionRecycler;
 import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.common.support.BaseIoConnectorConfig;
@@ -36,7 +35,7 @@
 public class DatagramConnectorConfig extends BaseIoConnectorConfig implements DatagramServiceConfig
 {
     private static final IoSessionRecycler DEFAULT_RECYCLER = new ExpiringSessionRecycler();
-    
+
     /**
      * Current session recycler
      */
@@ -46,7 +45,7 @@
 
     /**
      * Creates a new instance.
-     * 
+     *
      * @throws RuntimeIOException if failed to get the default configuration
      */
     public DatagramConnectorConfig()
@@ -55,7 +54,7 @@
     }
 
 
-    public IoSessionConfig getSessionConfig()
+    public DatagramSessionConfig getSessionConfig()
     {
         return sessionConfig;
     }

Modified: directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java?view=diff&rev=471549&r1=471548&r2=471549
==============================================================================
--- directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
(original)
+++ directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
Sun Nov  5 14:42:02 2006
@@ -403,8 +403,7 @@
                 }
 
                 ssc.socket().setReuseAddress( cfg.isReuseAddress() );
-                ssc.socket().setReceiveBufferSize(
-                    ( ( SocketSessionConfig ) cfg.getSessionConfig() ).getReceiveBufferSize()
);
+                ssc.socket().setReceiveBufferSize( cfg.getSessionConfig().getReceiveBufferSize()
);
 
                 // and bind.
                 ssc.socket().bind( req.address, cfg.getBacklog() );

Modified: directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptorConfig.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptorConfig.java?view=diff&rev=471549&r1=471548&r2=471549
==============================================================================
--- directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptorConfig.java
(original)
+++ directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptorConfig.java
Sun Nov  5 14:42:02 2006
@@ -6,28 +6,27 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.mina.transport.socket.nio;
 
+import java.io.IOException;
+import java.net.ServerSocket;
+
 import org.apache.mina.common.ExceptionMonitor;
 import org.apache.mina.common.IoAcceptorConfig;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.common.support.BaseIoAcceptorConfig;
 
-import java.io.IOException;
-import java.net.ServerSocket;
-
 /**
  * An {@link IoAcceptorConfig} for {@link SocketAcceptor}.
  *
@@ -36,13 +35,13 @@
  */
 public class SocketAcceptorConfig extends BaseIoAcceptorConfig
 {
-    private IoSessionConfig sessionConfig = new SocketSessionConfigImpl();
+    private SocketSessionConfig sessionConfig = new SocketSessionConfigImpl();
     private int backlog = 50;
     private boolean reuseAddress;
 
     /**
      * Creates a new instance.
-     * 
+     *
      * @throws RuntimeIOException if failed to get the default configuration
      */
     public SocketAcceptorConfig()
@@ -73,7 +72,7 @@
         }
     }
 
-    public IoSessionConfig getSessionConfig()
+    public SocketSessionConfig getSessionConfig()
     {
         return sessionConfig;
     }

Modified: directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnectorConfig.java
URL: http://svn.apache.org/viewvc/directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnectorConfig.java?view=diff&rev=471549&r1=471548&r2=471549
==============================================================================
--- directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnectorConfig.java
(original)
+++ directory/branches/mina/1.2/core/src/main/java/org/apache/mina/transport/socket/nio/SocketConnectorConfig.java
Sun Nov  5 14:42:02 2006
@@ -6,21 +6,20 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.mina.transport.socket.nio;
 
 import org.apache.mina.common.IoConnectorConfig;
-import org.apache.mina.common.IoSessionConfig;
 import org.apache.mina.common.RuntimeIOException;
 import org.apache.mina.common.support.BaseIoConnectorConfig;
 
@@ -32,18 +31,18 @@
  */
 public class SocketConnectorConfig extends BaseIoConnectorConfig
 {
-    private IoSessionConfig sessionConfig = new SocketSessionConfigImpl();
+    private SocketSessionConfig sessionConfig = new SocketSessionConfigImpl();
 
     /**
      * Creates a new instance.
-     * 
+     *
      * @throws RuntimeIOException if failed to get the default configuration
      */
     public SocketConnectorConfig()
     {
     }
 
-    public IoSessionConfig getSessionConfig()
+    public SocketSessionConfig getSessionConfig()
     {
         return sessionConfig;
     }



Mime
View raw message