You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by mh...@apache.org on 2007/01/26 00:43:34 UTC

svn commit: r500059 - /mina/sandbox/mheath/aioj/trunk/src/main/java/org/apache/aio/AsynchronousFileChannelFactory.java

Author: mheath
Date: Thu Jan 25 15:43:33 2007
New Revision: 500059

URL: http://svn.apache.org/viewvc?view=rev&rev=500059
Log:
Added first TestNG test testing asynchronous opens.

Modified:
    mina/sandbox/mheath/aioj/trunk/src/main/java/org/apache/aio/AsynchronousFileChannelFactory.java

Modified: mina/sandbox/mheath/aioj/trunk/src/main/java/org/apache/aio/AsynchronousFileChannelFactory.java
URL: http://svn.apache.org/viewvc/mina/sandbox/mheath/aioj/trunk/src/main/java/org/apache/aio/AsynchronousFileChannelFactory.java?view=diff&rev=500059&r1=500058&r2=500059
==============================================================================
--- mina/sandbox/mheath/aioj/trunk/src/main/java/org/apache/aio/AsynchronousFileChannelFactory.java (original)
+++ mina/sandbox/mheath/aioj/trunk/src/main/java/org/apache/aio/AsynchronousFileChannelFactory.java Thu Jan 25 15:43:33 2007
@@ -36,10 +36,10 @@
     }
 
     private static String getDefaultAsynchronousFileChannelProvider() {
-        if ("Linux".equals(System.getProperty("os.name"))) {
-            // TODO Determine if we should only use the POSIX provider if we're using a 2.6+ kernel
-            return PosixAsynchronousFileChannelProvider.class.getName();
-        }
+//        if ("Linux".equals(System.getProperty("os.name"))) {
+//            // TODO Determine if we should only use the POSIX provider if we're using a 2.6+ kernel
+//            return PosixAsynchronousFileChannelProvider.class.getName();
+//        }
         return ConcurrentAsynchronousFileChannelProvider.class.getName();
     }
 
@@ -53,6 +53,10 @@
 
     @SuppressWarnings("unchecked")
     public static AioFuture<AsynchronousFileChannel> open(final File file, final Modes mode, ExecutorService executorService, final Properties properties) {
+        if (file == null) {
+            throw new IllegalArgumentException("File can NOT be null");
+        }
+        
         String systemProvider = System.getProperty(
                 PROPERTY_ASYNCHRONOUS_FILE_CHANNEL_PROVIDER,
                 asynchronousFileChannelProvider);