You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2009/11/23 20:01:42 UTC
svn commit: r883464 - in
/activemq/sandbox/activemq-apollo/activemq-syscall/src:
main/java/org/apache/activemq/syscall/
main/java/org/apache/activemq/syscall/jni/ main/native-package/
test/java/org/apache/activemq/syscall/ test/java/org/apache/activemq...
Author: chirino
Date: Mon Nov 23 19:01:41 2009
New Revision: 883464
URL: http://svn.apache.org/viewvc?rev=883464&view=rev
Log:
Adding libaio interfaces, renamed the previou aio interface to PosixAIO
Added:
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/LibAIO.java
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/PosixAIO.java
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/Time.java
Removed:
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/AIO.java
Modified:
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AioPollAgent.java
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/FileDescriptor.java
activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/FileDescriptorTest.java
activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/jni/AIOTest.java
Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AioPollAgent.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AioPollAgent.java?rev=883464&r1=883463&r2=883464&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AioPollAgent.java (original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AioPollAgent.java Mon Nov 23 19:01:41 2009
@@ -5,13 +5,12 @@
import java.util.Set;
import java.util.concurrent.TimeUnit;
-import org.apache.activemq.syscall.jni.AIO;
+import org.apache.activemq.syscall.jni.Time.timespec;
import static java.util.concurrent.TimeUnit.*;
-
-import static org.apache.activemq.syscall.jni.AIO.*;
import static org.apache.activemq.syscall.jni.CLibrary.*;
-import static org.apache.activemq.syscall.jni.AIO.timespec.*;
+import static org.apache.activemq.syscall.jni.PosixAIO.*;
+import static org.apache.activemq.syscall.jni.Time.timespec.*;
public class AioPollAgent {
@@ -28,12 +27,12 @@
public void setTimeOut(long value, TimeUnit unit) {
synchronized (this) {
if( timeoutp == NULL ) {
- timeoutp = malloc(AIO.timespec.SIZEOF);
+ timeoutp = malloc(timespec.SIZEOF);
if( timeoutp == NULL ) {
throw new OutOfMemoryError();
}
}
- memmove(timeoutp, timespec(value, unit), AIO.timespec.SIZEOF);
+ memmove(timeoutp, timespec(value, unit), timespec.SIZEOF);
}
}
Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/FileDescriptor.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/FileDescriptor.java?rev=883464&r1=883463&r2=883464&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/FileDescriptor.java (original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/FileDescriptor.java Mon Nov 23 19:01:41 2009
@@ -20,12 +20,12 @@
import java.io.IOException;
import java.util.Collection;
-import org.apache.activemq.syscall.jni.AIO;
+import org.apache.activemq.syscall.jni.PosixAIO;
import org.apache.activemq.syscall.jni.IO;
-import org.apache.activemq.syscall.jni.AIO.aiocb;
+import org.apache.activemq.syscall.jni.PosixAIO.aiocb;
import org.apache.activemq.syscall.jni.IO.iovec;
-import static org.apache.activemq.syscall.jni.AIO.*;
+import static org.apache.activemq.syscall.jni.PosixAIO.*;
import static org.apache.activemq.syscall.jni.CLibrary.*;
import static org.apache.activemq.syscall.jni.IO.*;
import static org.apache.activemq.syscall.jni.IO.iovec.*;
@@ -187,7 +187,7 @@
}
public boolean isAsyncIOSupported() {
- return AIO.SUPPORTED;
+ return PosixAIO.SUPPORTED;
}
/**
Added: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/LibAIO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/LibAIO.java?rev=883464&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/LibAIO.java (added)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/LibAIO.java Mon Nov 23 19:01:41 2009
@@ -0,0 +1,194 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file 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.
+ */
+package org.apache.activemq.syscall.jni;
+
+import org.fusesource.hawtjni.runtime.ClassFlag;
+import org.fusesource.hawtjni.runtime.FieldFlag;
+import org.fusesource.hawtjni.runtime.JniArg;
+import org.fusesource.hawtjni.runtime.JniClass;
+import org.fusesource.hawtjni.runtime.JniField;
+import org.fusesource.hawtjni.runtime.JniMethod;
+
+import static org.fusesource.hawtjni.runtime.MethodFlag.*;
+
+/**
+ * Java binding to the libaio syscall facility on Linux.
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+@JniClass(conditional="defined(HAVE_LIBAIO_H)")
+final public class LibAIO {
+ static {
+ CLibrary.LIBRARY.load();
+ init();
+ }
+
+ @JniMethod(flags={CONSTANT_INITIALIZER})
+ private static final native void init();
+
+ @JniField(flags={FieldFlag.CONSTANT}, accessor="1")
+ public static boolean SUPPORTED;
+
+
+ @JniClass(flags={ClassFlag.STRUCT}, conditional="defined(HAVE_LIBAIO_H)")
+ public static final class iocb {
+ static {
+ CLibrary.LIBRARY.load();
+ init();
+ }
+ @JniMethod(flags={CONSTANT_INITIALIZER})
+ private static final native void init();
+
+ @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct iocb)")
+ public static int SIZEOF;
+
+ @JniField(cast="void *")
+ long data;
+ @JniField(cast="unsigned")
+ int key;
+ @JniField(cast="short")
+ short aio_lio_opcode;
+ @JniField(cast="short")
+ short aio_reqprio;
+ @JniField(cast="int")
+ int aio_fildes;
+ }
+
+ @JniClass(flags={ClassFlag.STRUCT}, conditional="defined(HAVE_LIBAIO_H)")
+ public static final class io_event {
+ static {
+ CLibrary.LIBRARY.load();
+ init();
+ }
+ @JniMethod(flags={CONSTANT_INITIALIZER})
+ private static final native void init();
+
+ @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct io_event)")
+ public static int SIZEOF;
+
+ @JniField(cast="void *")
+ long data;
+ @JniField(cast="struct iocb *")
+ long obj;
+ long res;
+ long res2;
+ };
+
+ ///////////////////////////////////////////////////////////////////
+ // These are the actual syscalls
+ ///////////////////////////////////////////////////////////////////
+
+ public static final native int io_setup(int nr_events,
+ @JniArg(cast="struct io_context **")long ctxp[]);
+
+ public static final native int io_destroy(
+ @JniArg(cast="struct io_context *")long ctx_id);
+
+ public static final native int io_submit(
+ @JniArg(cast="struct io_context *")long ctx_id,
+ long nr,
+ @JniArg(cast="struct iocb **")long iocbpp[]);
+
+ public static final native int io_getevents(
+ @JniArg(cast="struct io_context *")long ctx_id,
+ long min_nr,
+ long nr,
+ @JniArg(cast="struct io_event *")long events,
+ @JniArg(cast="struct timespec *")long timeout
+ );
+
+ public static final native int io_cancel(
+ @JniArg(cast="struct io_context *")long ctx_id,
+ @JniArg(cast="struct iocb *")long iocbp,
+ @JniArg(cast="struct io_event *")long resultp);
+
+
+ ///////////////////////////////////////////////////////////////////
+ // These are libaio helper functions
+ ///////////////////////////////////////////////////////////////////
+
+ public static final native int io_queue_init(
+ int maxevents,
+ @JniArg(cast="struct io_context **") long ctxp[]);
+ public static final native int io_queue_release(
+ @JniArg(cast="struct io_context *") long ctx);
+ public static final native int io_queue_run(
+ @JniArg(cast="struct io_context **") long ctx);
+
+ public static final native void io_set_callback(
+ @JniArg(cast="struct iocb *")long iocb,
+ @JniArg(cast="io_callback_t")long cb);
+
+ public static final native void io_prep_pread(
+ @JniArg(cast="struct iocb *")long iocb,
+ int fd,
+ @JniArg(cast="void *") long buf,
+ @JniArg(cast="site_t") long count,
+ long offset);
+
+ public static final native void io_prep_pwrite(
+ @JniArg(cast="struct iocb *")long iocb,
+ int fd,
+ @JniArg(cast="void *") long buf,
+ @JniArg(cast="site_t") long count,
+ long offset);
+
+ public static final native void io_prep_preadv(
+ @JniArg(cast="struct iocb *")long iocb,
+ int fd,
+ @JniArg(cast="const struct iovec *") long iov,
+ int iovcnt,
+ long offset);
+
+ public static final native void io_prep_pwritev(
+ @JniArg(cast="struct iocb *")long iocb,
+ int fd,
+ @JniArg(cast="const struct iovec *") long iov,
+ int iovcnt,
+ long offset);
+
+ public static final native int io_poll(
+ @JniArg(cast="struct io_context *")long ctx,
+ @JniArg(cast="struct iocb *")long iocb,
+ @JniArg(cast="io_callback_t")long cb,
+ int fd,
+ int events);
+
+ public static final native void io_prep_fsync(
+ @JniArg(cast="struct iocb *")long iocb,
+ int fd);
+
+ public static final native int io_fsync(
+ @JniArg(cast="struct io_context *")long ctx,
+ @JniArg(cast="struct iocb *")long iocb,
+ @JniArg(cast="io_callback_t")long cb,
+ int fd);
+
+ public static final native void io_prep_fdsync(
+ @JniArg(cast="struct iocb *")long iocb,
+ int fd);
+
+ public static final native int io_fdsync(
+ @JniArg(cast="struct io_context *")long ctx,
+ @JniArg(cast="struct iocb *")long iocb,
+ @JniArg(cast="io_callback_t")long cb,
+ int fd);
+
+ public static final native void io_set_eventfd(
+ @JniArg(cast="struct iocb *")long iocb,
+ int eventfd);
+}
Added: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/PosixAIO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/PosixAIO.java?rev=883464&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/PosixAIO.java (added)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/PosixAIO.java Mon Nov 23 19:01:41 2009
@@ -0,0 +1,141 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file 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.
+ */
+package org.apache.activemq.syscall.jni;
+
+import org.fusesource.hawtjni.runtime.ClassFlag;
+import org.fusesource.hawtjni.runtime.FieldFlag;
+import org.fusesource.hawtjni.runtime.JniArg;
+import org.fusesource.hawtjni.runtime.JniClass;
+import org.fusesource.hawtjni.runtime.JniField;
+import org.fusesource.hawtjni.runtime.JniMethod;
+
+import static org.fusesource.hawtjni.runtime.ArgFlag.*;
+import static org.fusesource.hawtjni.runtime.MethodFlag.*;
+
+/**
+ * Java binding to the Posix aio system calls.
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+@JniClass(conditional="defined(HAVE_AIO_H)")
+public class PosixAIO {
+ static {
+ CLibrary.LIBRARY.load();
+ init();
+ }
+
+ @JniMethod(flags={CONSTANT_INITIALIZER})
+ private static final native void init();
+
+ @JniField(flags={FieldFlag.CONSTANT}, accessor="1")
+ public static boolean SUPPORTED;
+
+ @JniField(flags={FieldFlag.CONSTANT})
+ public static int EINPROGRESS;
+
+// @JniField(flags={FieldFlag.CONSTANT})
+// public static int ECANCELLED;
+
+ @JniClass(flags={ClassFlag.STRUCT, ClassFlag.ZERO_OUT}, conditional="defined(HAVE_AIO_H)")
+ static public class aiocb {
+ static {
+ CLibrary.LIBRARY.load();
+ init();
+ }
+
+ @JniMethod(flags={CONSTANT_INITIALIZER})
+ private static final native void init();
+
+ @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct aiocb)")
+ public static int SIZEOF;
+
+ public int aio_fildes;
+ @JniField(cast="void *")
+ public long aio_buf;
+ @JniField(cast="size_t")
+ public long aio_nbytes;
+ @JniField(cast="off_t")
+ public long aio_offset;
+ // Don't need to access these right now:
+ // int aio_reqprio;
+ // struct sigevent aio_sigevent
+ // int aio_lio_opcode;
+ // int aio_flags;
+
+ public static final native void memmove (
+ @JniArg(cast="void *", flags={NO_IN, CRITICAL}) aiocb dest,
+ @JniArg(cast="const void *") long src,
+ @JniArg(cast="size_t") long size);
+
+ public static final native void memmove (
+ @JniArg(cast="void *") long dest,
+ @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) aiocb src,
+ @JniArg(cast="size_t") long size);
+ }
+
+ /**
+ * <code><pre>
+ * int aio_read(struct aiocb *aiocbp);
+ * </pre></code>
+ */
+ public static final native int aio_read(
+ @JniArg(cast="struct aiocb *")long aiocbp);
+
+ /**
+ * <code><pre>
+ * int aio_write(struct aiocb *aiocbp);
+ * </pre></code>
+ */
+ public static final native int aio_write(
+ @JniArg(cast="struct aiocb *")long aiocbp);
+
+ /**
+ * <code><pre>
+ * int aio_cancel(int fd, struct aiocb *aiocbp);
+ * </pre></code>
+ */
+ public static final native int aio_cancel(
+ int fd,
+ @JniArg(cast="struct aiocb *")long aiocbp);
+
+ /**
+ * <code><pre>
+ * int aio_error(const struct aiocb *aiocbp);
+ * </pre></code>
+ */
+ public static final native int aio_error(
+ @JniArg(cast="const struct aiocb *")long aiocbp);
+
+ /**
+ * <code><pre>
+ * ssize_t aio_return(struct aiocb *aiocbp);
+ * </pre></code>
+ */
+ public static final native long aio_return(
+ @JniArg(cast="struct aiocb *")long aiocbp);
+
+ /**
+ * <code><pre>
+ * int aio_suspend(const struct aiocb *const list[], int nent, const struct timespec *timeout);
+ * </pre></code>
+ */
+ public static final native int aio_suspend(
+ @JniArg(cast="const struct aiocb *const*")long[] list,
+ int nent,
+ @JniArg(cast="struct timespec *")long timeout);
+
+}
Added: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/Time.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/Time.java?rev=883464&view=auto
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/Time.java (added)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/jni/Time.java Mon Nov 23 19:01:41 2009
@@ -0,0 +1,71 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file 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.
+ */
+package org.apache.activemq.syscall.jni;
+
+import org.fusesource.hawtjni.runtime.ClassFlag;
+import org.fusesource.hawtjni.runtime.FieldFlag;
+import org.fusesource.hawtjni.runtime.JniArg;
+import org.fusesource.hawtjni.runtime.JniClass;
+import org.fusesource.hawtjni.runtime.JniField;
+import org.fusesource.hawtjni.runtime.JniMethod;
+
+import static org.fusesource.hawtjni.runtime.ArgFlag.*;
+import static org.fusesource.hawtjni.runtime.MethodFlag.*;
+
+/**
+ * Time related functions and structures.
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+// @JniClass(conditional="defined(HAVE_LIBAIO_H)")
+public class Time {
+
+ static {
+ CLibrary.LIBRARY.load();
+ }
+
+ @JniClass(flags={ClassFlag.STRUCT})
+ static public class timespec {
+
+ static {
+ CLibrary.LIBRARY.load();
+ init();
+ }
+
+ @JniMethod(flags={CONSTANT_INITIALIZER})
+ private static final native void init();
+
+ @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct timespec)")
+ public static int SIZEOF;
+
+ @JniField(cast="time_t")
+ public long tv_sec;
+ @JniField(cast="long")
+ public long tv_nsec;
+
+ public static final native void memmove (
+ @JniArg(cast="void *", flags={NO_IN, CRITICAL}) timespec dest,
+ @JniArg(cast="const void *") long src,
+ @JniArg(cast="size_t") long size);
+
+ public static final native void memmove (
+ @JniArg(cast="void *") long dest,
+ @JniArg(cast="const void *", flags={NO_OUT, CRITICAL}) timespec src,
+ @JniArg(cast="size_t") long size);
+ }
+
+}
\ No newline at end of file
Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac?rev=883464&r1=883463&r2=883464&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac (original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac Mon Nov 23 19:01:41 2009
@@ -41,7 +41,7 @@
WITH_OSX_UNIVERSAL
WITH_JNI_JDK
-# Look for the AIO api..
+# Look for the Posix AIO api..
AC_CHECK_HEADER([aio.h],[
for lib in [aio c rt] ; do
AC_CHECK_LIB([$lib], [aio_read],[
@@ -52,6 +52,15 @@
done
])
+# Look for the libaio api..
+AC_CHECK_HEADER([libaio.h],[
+ AC_CHECK_LIB([libaio], [io_queue_run],[
+ LDFLAGS="$LDFLAGS -llibaio"
+ AC_DEFINE([HAVE_LIBAIO_H], [1], [Define to 1 if you have the <libaio.h> header file.])
+ break
+ ])
+])
+
AC_CHECK_LIB([c], [fcntl],[AC_DEFINE([HAVE_FCNTL_FUNCTION], [1], [Define to 1 if you have the fcntl function.])])
AC_CHECK_LIB([c], [posix_memalign],[AC_DEFINE([HAVE_POSIX_MEMALIGN_FUNCTION], [1], [Define to 1 if you have the posix_memalign function.])])
AC_CHECK_LIB([c], [pread],[AC_DEFINE([HAVE_PREAD_FUNCTION], [1], [Define to 1 if you have the pread function.])])
Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/FileDescriptorTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/FileDescriptorTest.java?rev=883464&r1=883463&r2=883464&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/FileDescriptorTest.java (original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/FileDescriptorTest.java Mon Nov 23 19:01:41 2009
@@ -22,11 +22,11 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.apache.activemq.syscall.jni.AIO;
+import org.apache.activemq.syscall.jni.PosixAIO;
import org.junit.Test;
import static org.apache.activemq.syscall.NativeAllocation.*;
-import static org.apache.activemq.syscall.TestSupport.*;
+import static org.apache.activemq.syscall.TestSupport.*;
import static org.apache.activemq.syscall.jni.IO.*;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
@@ -40,7 +40,7 @@
@Test
public void writeWithACallback() throws IOException, InterruptedException, ExecutionException, TimeoutException {
- assumeThat(AIO.SUPPORTED, is(true));
+ assumeThat(PosixAIO.SUPPORTED, is(true));
String expected = generateString(1024*4);
NativeAllocation buffer = allocate(expected);
@@ -69,7 +69,7 @@
@Test
public void readWithACallback() throws IOException, InterruptedException, ExecutionException, TimeoutException {
- assumeThat(AIO.SUPPORTED, is(true));
+ assumeThat(PosixAIO.SUPPORTED, is(true));
String expected = generateString(1024*4);
@@ -96,7 +96,7 @@
@Test
public void read() throws IOException, InterruptedException, ExecutionException, TimeoutException {
- assumeThat(AIO.SUPPORTED, is(true));
+ assumeThat(PosixAIO.SUPPORTED, is(true));
String expected = "Hello World";
Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/jni/AIOTest.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/jni/AIOTest.java?rev=883464&r1=883463&r2=883464&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/jni/AIOTest.java (original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/test/java/org/apache/activemq/syscall/jni/AIOTest.java Mon Nov 23 19:01:41 2009
@@ -20,12 +20,12 @@
import java.io.IOException;
import org.apache.activemq.syscall.NativeAllocation;
-import org.apache.activemq.syscall.jni.AIO.aiocb;
+import org.apache.activemq.syscall.jni.PosixAIO.aiocb;
import org.junit.Test;
import static org.apache.activemq.syscall.NativeAllocation.*;
import static org.apache.activemq.syscall.TestSupport.*;
-import static org.apache.activemq.syscall.jni.AIO.*;
+import static org.apache.activemq.syscall.jni.PosixAIO.*;
import static org.apache.activemq.syscall.jni.CLibrary.*;
import static org.apache.activemq.syscall.jni.IO.*;
import static org.hamcrest.CoreMatchers.*;
@@ -41,7 +41,7 @@
@Test
public void write() throws IOException, InterruptedException {
- assumeThat(AIO.SUPPORTED, is(true));
+ assumeThat(PosixAIO.SUPPORTED, is(true));
File file = dataFile(AIOTest.class.getName()+".write.data");