summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog12
-rw-r--r--gnu/java/nio/SelectorImpl.java15
-rw-r--r--include/Makefile.am6
-rw-r--r--include/gnu_java_nio_SelectorImpl.h19
-rw-r--r--include/gnu_java_nio_VMSelector.h19
-rw-r--r--native/jni/java-nio/Makefile.am2
-rw-r--r--native/jni/java-nio/gnu_java_nio_VMSelector.c (renamed from native/jni/java-nio/gnu_java_nio_SelectorImpl.c)8
-rw-r--r--vm/reference/gnu/java/nio/VMSelector.java59
8 files changed, 99 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c687e688..1141b7ba0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2004-07-31 Patrik Reali <reali@acm.org>
+
+ * gnu/java/nio/SelectorImpl.java,
+ include/Makefile.am,
+ include/gnu_java_nio_SelectorImpl.h,
+ include/gnu_java_nio_VMSelector.h,
+ native/jni/java-nio/Makefile.am,
+ native/jni/java-nio/gnu_java_nio_SelectorImpl.c,
+ native/jni/java-nio/gnu_java_nio_VMSelector.c,
+ vm/reference/gnu/java/nio/VMSelector.java: native method moved from
+ gnu/java/nio/SelectorImpl to vm/reference/gnu/java/nio/VMSelector
+
2004-07-31 Kim Ho <kho@redhat.com>
* java/awt/Container.java:
diff --git a/gnu/java/nio/SelectorImpl.java b/gnu/java/nio/SelectorImpl.java
index 239a5f8ef..62d066246 100644
--- a/gnu/java/nio/SelectorImpl.java
+++ b/gnu/java/nio/SelectorImpl.java
@@ -53,14 +53,6 @@ import gnu.classpath.Configuration;
public class SelectorImpl extends AbstractSelector
{
- static
- {
- // load the shared library needed for native methods.
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary ("javanio");
- }
- }
private Set keys;
private Set selected;
@@ -140,11 +132,6 @@ public class SelectorImpl extends AbstractSelector
return select (0);
}
- // A timeout value of 0 means block forever.
- private static native int implSelect (int[] read, int[] write,
- int[] except, long timeout)
- throws IOException;
-
private final int[] getFDsAsArray (int ops)
{
int[] result;
@@ -237,7 +224,7 @@ public class SelectorImpl extends AbstractSelector
try
{
begin();
- result = implSelect (read, write, except, timeout);
+ result = VMSelector.select (read, write, except, timeout);
}
finally
{
diff --git a/include/Makefile.am b/include/Makefile.am
index 9dee34b6e..6f0d87734 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -42,7 +42,7 @@ $(top_srcdir)/include/gnu_java_net_PlainDatagramSocketImpl.h \
$(top_srcdir)/include/gnu_java_net_PlainSocketImpl.h \
$(top_srcdir)/include/gnu_java_nio_NIOServerSocket.h \
$(top_srcdir)/include/gnu_java_nio_VMPipe.h \
-$(top_srcdir)/include/gnu_java_nio_SelectorImpl.h \
+$(top_srcdir)/include/gnu_java_nio_VMSelector.h \
$(top_srcdir)/include/gnu_java_nio_channels_FileChannelImpl.h \
$(top_srcdir)/include/java_io_ObjectInputStream.h \
$(top_srcdir)/include/java_io_VMFile.h \
@@ -140,8 +140,8 @@ $(top_srcdir)/include/gnu_java_nio_NIOServerSocket.h: $(top_srcdir)/gnu/java/nio
$(JAVAH) -o $@ gnu.java.nio.NIOServerSocket
$(top_srcdir)/include/gnu_java_nio_VMPipe.h: ../vm/current/gnu/java/nio/VMPipe.java
$(JAVAH) -o $@ gnu.java.nio.VMPipe
-$(top_srcdir)/include/gnu_java_nio_SelectorImpl.h: $(top_srcdir)/gnu/java/nio/SelectorImpl.java
- $(JAVAH) -o $@ gnu.java.nio.SelectorImpl
+$(top_srcdir)/include/gnu_java_nio_VMSelector.h: ../vm/current/gnu/java/nio/VMSelector.java
+ $(JAVAH) -o $@ gnu.java.nio.VMSelector
$(top_srcdir)/include/java_io_ObjectInputStream.h: $(top_srcdir)/java/io/ObjectInputStream.java
$(JAVAH) -o $@ java.io.ObjectInputStream
$(top_srcdir)/include/java_io_VMFile.h: ../vm/current/java/io/VMFile.java
diff --git a/include/gnu_java_nio_SelectorImpl.h b/include/gnu_java_nio_SelectorImpl.h
deleted file mode 100644
index b199f8950..000000000
--- a/include/gnu_java_nio_SelectorImpl.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-
-#ifndef __gnu_java_nio_SelectorImpl__
-#define __gnu_java_nio_SelectorImpl__
-
-#include <jni.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-JNIEXPORT jint JNICALL Java_gnu_java_nio_SelectorImpl_implSelect (JNIEnv *env, jclass, jintArray, jintArray, jintArray, jlong);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gnu_java_nio_SelectorImpl__ */
diff --git a/include/gnu_java_nio_VMSelector.h b/include/gnu_java_nio_VMSelector.h
new file mode 100644
index 000000000..495f0108c
--- /dev/null
+++ b/include/gnu_java_nio_VMSelector.h
@@ -0,0 +1,19 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+
+#ifndef __gnu_java_nio_VMSelector__
+#define __gnu_java_nio_VMSelector__
+
+#include <jni.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+JNIEXPORT jint JNICALL Java_gnu_java_nio_VMSelector_select (JNIEnv *env, jclass, jintArray, jintArray, jintArray, jlong);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __gnu_java_nio_VMSelector__ */
diff --git a/native/jni/java-nio/Makefile.am b/native/jni/java-nio/Makefile.am
index d04049f5e..1e8dac90f 100644
--- a/native/jni/java-nio/Makefile.am
+++ b/native/jni/java-nio/Makefile.am
@@ -2,7 +2,7 @@ pkglib_LTLIBRARIES = libjavanio.la
libjavanio_la_SOURCES = gnu_java_nio_NIOServerSocket.c \
gnu_java_nio_VMPipe.c \
- gnu_java_nio_SelectorImpl.c \
+ gnu_java_nio_VMSelector.c \
gnu_java_nio_channels_FileChannelImpl.c \
java_nio_DirectByteBufferImpl.c \
java_nio_MappedByteBufferImpl.c \
diff --git a/native/jni/java-nio/gnu_java_nio_SelectorImpl.c b/native/jni/java-nio/gnu_java_nio_VMSelector.c
index f33f892d9..b1d8cb711 100644
--- a/native/jni/java-nio/gnu_java_nio_SelectorImpl.c
+++ b/native/jni/java-nio/gnu_java_nio_VMSelector.c
@@ -1,4 +1,4 @@
-/* gnu_java_nio_SelectorImpl.c - Native methods for SelectorImpl class
+/* gnu_java_nio_VMSelector.c - Native methods for SelectorImpl class
Copyright (C) 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,16 +41,16 @@ exception statement from your version. */
#include <jni.h>
#include <jcl.h>
-#include "gnu_java_nio_SelectorImpl.h"
+#include "gnu_java_nio_VMSelector.h"
#define IO_EXCEPTION "java/io/IOException"
JNIEXPORT jint JNICALL
-Java_gnu_java_nio_SelectorImpl_implSelect (JNIEnv *env, jclass obj,
+Java_gnu_java_nio_VMSelector_select (JNIEnv *env, jclass obj,
jintArray read, jintArray write,
jintArray except, jlong timeout)
{
- JCL_ThrowException (env, IO_EXCEPTION, "gnu.java.nio.SelectorImpl.implSelect(): not implemented");
+ JCL_ThrowException (env, IO_EXCEPTION, "gnu.java.nio.VMSelector.select(): not implemented");
return 0;
}
diff --git a/vm/reference/gnu/java/nio/VMSelector.java b/vm/reference/gnu/java/nio/VMSelector.java
new file mode 100644
index 000000000..7d0606a77
--- /dev/null
+++ b/vm/reference/gnu/java/nio/VMSelector.java
@@ -0,0 +1,59 @@
+/* VMSelector.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.nio;
+
+import gnu.classpath.Configuration;
+import java.io.IOException;
+
+public final class VMSelector
+{
+ static
+ {
+ // load the shared library needed for native methods.
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary ("javanio");
+ }
+ }
+
+ // A timeout value of 0 means block forever.
+ static native int select (int[] read, int[] write,
+ int[] except, long timeout)
+ throws IOException;
+
+}