directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r370808 - in /directory/sandbox/trustin/mina-spi/core/src: main/java/org/apache/mina/common/ main/java/org/apache/mina/transport/socket/nio/ main/java/org/apache/mina/transport/vmpipe/ main/java/org/apache/mina/util/ test/java/org/apache/mi...
Date Fri, 20 Jan 2006 14:00:19 GMT
Author: trustin
Date: Fri Jan 20 06:00:05 2006
New Revision: 370808

URL: http://svn.apache.org/viewcvs?rev=370808&view=rev
Log:
Related issue: DIRMINA-148 (Provide global service registry which provides IoAcceptors and
IoConnectors using Java SPI.)
* Added two default service providers
* Added missing license statements

Added:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
  (with props)
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
  (with props)
    directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
  (with props)
Modified:
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
    directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
    directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/IoAddressTest.java

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java?rev=370808&r1=370807&r2=370808&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/common/MINA.java
Fri Jan 20 06:00:05 2006
@@ -21,8 +21,10 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 import org.apache.mina.common.support.discovery.tools.Service;
+import org.apache.mina.util.IdentityHashSet;
 
 public class MINA
 {
@@ -76,5 +78,12 @@
         }
     }
     
+    public static Set getProviders()
+    {
+        synchronized( providers )
+        {
+            return new IdentityHashSet( providers.values() );
+        }
+    }
     
 }

Added: 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=370808&view=auto
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
(added)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
Fri Jan 20 06:00:05 2006
@@ -0,0 +1,43 @@
+/*
+ *   @(#) $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.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;
+
+public class NioServiceProvider implements IoServiceProvider
+{
+    public String getName()
+    {
+        return "nio";
+    }
+
+    public IoAcceptor getAcceptor( IoAddress address )
+    {
+        return null;
+    }
+
+    public IoConnector getConnector( IoAddress address )
+    {
+        return null;
+    }
+
+}

Propchange: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/socket/nio/NioServiceProvider.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Added: 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=370808&view=auto
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
(added)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
Fri Jan 20 06:00:05 2006
@@ -0,0 +1,44 @@
+/*
+ *   @(#) $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.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;
+
+public class VmPipeServiceProvider implements IoServiceProvider
+{
+
+    public String getName()
+    {
+        return "vm";
+    }
+
+    public IoAcceptor getAcceptor( IoAddress address )
+    {
+        return null;
+    }
+
+    public IoConnector getConnector( IoAddress address )
+    {
+        return null;
+    }
+
+}

Propchange: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/transport/vmpipe/VmPipeServiceProvider.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision

Modified: directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/util/IdentityHashSet.java?rev=370808&r1=370807&r2=370808&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/main/java/org/apache/mina/util/IdentityHashSet.java
Fri Jan 20 06:00:05 2006
@@ -19,6 +19,7 @@
 package org.apache.mina.util;
 
 import java.util.AbstractSet;
+import java.util.Collection;
 import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -36,6 +37,11 @@
 
     public IdentityHashSet()
     {
+    }
+    
+    public IdentityHashSet( Collection c )
+    {
+        this.addAll( c );
     }
 
     public int size()

Modified: directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/IoAddressTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/IoAddressTest.java?rev=370808&r1=370807&r2=370808&view=diff
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/IoAddressTest.java
(original)
+++ directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/IoAddressTest.java
Fri Jan 20 06:00:05 2006
@@ -1,3 +1,21 @@
+/*
+ *   @(#) $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;
 
 import junit.framework.Assert;

Added: directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java?rev=370808&view=auto
==============================================================================
--- directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
(added)
+++ directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
Fri Jan 20 06:00:05 2006
@@ -0,0 +1,35 @@
+/*
+ *   @(#) $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;
+
+import junit.framework.TestCase;
+
+public class ServiceProviderTest extends TestCase
+{
+
+    public static void main( String[] args )
+    {
+        junit.textui.TestRunner.run( ServiceProviderTest.class );
+    }
+
+    public void testDefaultProviders()
+    {
+        System.out.println( MINA.getProviders() );
+    }
+}

Propchange: directory/sandbox/trustin/mina-spi/core/src/test/java/org/apache/mina/common/ServiceProviderTest.java
------------------------------------------------------------------------------
    svn:keywords = HeadURL Id LastChangedBy LastChangedDate LastChangedRevision



Mime
View raw message