directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r370813 - in /directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina: common/IoServiceProvider.java transport/socket/nio/NioServiceProvider.java transport/vmpipe/VmPipeServiceProvider.java
Date Fri, 20 Jan 2006 14:21:26 GMT
Author: trustin
Date: Fri Jan 20 06:21:21 2006
New Revision: 370813

URL: http://svn.apache.org/viewcvs?rev=370813&view=rev
Log:
Changed the interface of IoServiceProvider so the change can happen gradually.

Modified:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoServiceProvider.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoServiceProvider.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoServiceProvider.java?rev=370813&r1=370812&r2=370813&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoServiceProvider.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/IoServiceProvider.java
Fri Jan 20 06:21:21 2006
@@ -1,9 +1,31 @@
+/*
+ *   @(#) $Id$
+ *
+ *   Copyright 2004 The Apache Software Foundation
+ *
+ *   Licensed 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.
+ *
+ */
 package org.apache.mina.common;
 
-
+/**
+ *
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
 public interface IoServiceProvider
 {
     String getName();
-    IoAcceptor getAcceptor( IoAddress address );
-    IoConnector getConnector( IoAddress address );
+    IoAcceptor newAcceptor( String transportType );
+    IoConnector newConnector( String transportType );
 }

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java?rev=370813&r1=370812&r2=370813&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
Fri Jan 20 06:21:21 2006
@@ -19,7 +19,6 @@
 package org.apache.mina.transport.socket.nio;
 
 import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoAddress;
 import org.apache.mina.common.IoConnector;
 import org.apache.mina.common.IoServiceProvider;
 
@@ -30,14 +29,31 @@
         return "nio";
     }
 
-    public IoAcceptor getAcceptor( IoAddress address )
+    public IoAcceptor newAcceptor( String transportType )
     {
+        if( "socket".equals( transportType ) )
+        {
+            return new SocketAcceptor();
+        }
+        else if ( "datagram".equals( transportType ) )
+        {
+            return new DatagramAcceptor();
+        }
+
         return null;
     }
 
-    public IoConnector getConnector( IoAddress address )
+    public IoConnector newConnector( String transportType )
     {
+        if( "socket".equals( transportType ) )
+        {
+            return new SocketConnector();
+        }
+        else if ( "datagram".equals( transportType ) )
+        {
+            return new DatagramConnector();
+        }
+
         return null;
     }
-
 }

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java?rev=370813&r1=370812&r2=370813&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
Fri Jan 20 06:21:21 2006
@@ -19,7 +19,6 @@
 package org.apache.mina.transport.vmpipe;
 
 import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.common.IoAddress;
 import org.apache.mina.common.IoConnector;
 import org.apache.mina.common.IoServiceProvider;
 
@@ -31,13 +30,23 @@
         return "vm";
     }
 
-    public IoAcceptor getAcceptor( IoAddress address )
+    public IoAcceptor newAcceptor( String transportType )
     {
+        if( "pipe".equals( transportType ) )
+        {
+            return new VmPipeAcceptor();
+        }
+        
         return null;
     }
 
-    public IoConnector getConnector( IoAddress address )
+    public IoConnector newConnector( String transportType )
     {
+        if( "pipe".equals( transportType ) )
+        {
+            return new VmPipeConnector();
+        }
+        
         return null;
     }
 



Mime
View raw message