activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r880802 - in /activemq/sandbox/activemq-apollo/activemq-syscall: activemq-syscall/ src/main/java/org/apache/activemq/syscall/ src/main/native-package/ src/main/native-package/src/
Date Mon, 16 Nov 2009 15:37:53 GMT
Author: chirino
Date: Mon Nov 16 15:37:53 2009
New Revision: 880802

URL: http://svn.apache.org/viewvc?rev=880802&view=rev
Log:
starting to beef up the aio interface..

Removed:
    activemq/sandbox/activemq-apollo/activemq-syscall/activemq-syscall/
Modified:
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/configure.ac
    activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java?rev=880802&r1=880801&r2=880802&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/AIO.java
Mon Nov 16 15:37:53 2009
@@ -23,6 +23,8 @@
 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.*;
 
 /**
@@ -31,12 +33,25 @@
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 @JniClass
-public class AIO extends CLibrary {
+public class AIO {
+    static {
+        CLibrary.LIBRARY.load();
+        init();
+    }
+    
+    @JniMethod(flags={CONSTANT_INITIALIZER})
+    private static final native void init();
+    
+    @JniField(flags={FieldFlag.CONSTANT})
+    public static int EINPROGRESS;
+    
+//    @JniField(flags={FieldFlag.CONSTANT})
+//    public static int ECANCELLED;
 
     @JniClass(flags={ClassFlag.STRUCT})
     static public class aiocb {
         static {
-            LIBRARY.load();
+            CLibrary.LIBRARY.load();
             init();
         }
         
@@ -46,18 +61,28 @@
         @JniField(flags={FieldFlag.CONSTANT}, accessor="sizeof(struct aiocb)")
         public static int SIZEOF;
         
-        int aio_fildes;
+        public int aio_fildes;
         @JniField(cast="void *")
-        long aio_buf;
+        public long aio_buf;
         @JniField(cast="size_t")
-        long aio_nbytes;
+        public long aio_nbytes;
         @JniField(cast="off_t")
-        long aio_offset;
+        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);
     }
     
     @JniClass(flags={ClassFlag.STRUCT})
@@ -82,6 +107,14 @@
 
     /**
      * <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>
      */

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java?rev=880802&r1=880801&r2=880802&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/CLibrary.java
Mon Nov 16 15:37:53 2009
@@ -20,6 +20,7 @@
 import org.fusesource.hawtjni.runtime.JniClass;
 import org.fusesource.hawtjni.runtime.JniMethod;
 import org.fusesource.hawtjni.runtime.Library;
+import org.fusesource.hawtjni.runtime.MethodFlag;
 
 import static org.fusesource.hawtjni.runtime.ArgFlag.*;
 import static org.fusesource.hawtjni.runtime.Pointer.*;
@@ -35,6 +36,11 @@
         LIBRARY.load();
     }
     
+    final public static long NULL = 0;
+    
+    @JniMethod(flags={MethodFlag.CONSTANT})
+    public static final native int errno();
+    
     ///////////////////////////////////////////////////////////////////
     //
     // String related methods 

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java?rev=880802&r1=880801&r2=880802&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/java/org/apache/activemq/syscall/IO.java
Mon Nov 16 15:37:53 2009
@@ -29,11 +29,12 @@
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
 @JniClass
-public class IO extends CLibrary {
+public class IO {
 
     @JniMethod(flags={CONSTANT_INITIALIZER})
     private static final native void init();
     static {
+        CLibrary.LIBRARY.load();
         init();
     }
 

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=880802&r1=880801&r2=880802&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 16 15:37:53 2009
@@ -52,6 +52,8 @@
   done
 ])
 
+AC_CHECK_HEADER([sys/errno.h],[AC_DEFINE([HAVE_SYS_ERRNO_H], [1], [Define to 1 if you have
the <sys/errno.h> header file.])])
+
 CFLAGS="$CFLAGS $JNI_EXTRA_CFLAGS"
 LDFLAGS="$LDFLAGS $JNI_EXTRA_LDFLAGS -release $PACKAGE_VERSION"
 

Modified: activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h
URL: http://svn.apache.org/viewvc/activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h?rev=880802&r1=880801&r2=880802&view=diff
==============================================================================
--- activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h
(original)
+++ activemq/sandbox/activemq-apollo/activemq-syscall/src/main/native-package/src/activemq-syscall.h
Mon Nov 16 15:37:53 2009
@@ -28,6 +28,9 @@
   #include <aio.h>
 #endif
 
-#include <fcntl.h>
+#ifdef HAVE_SYS_ERRNO_H
+  #include <sys/errno.h>
+#endif
 
-#endif /* INCLUDED_ACTIVEMQ_SYSCALL_H */
\ No newline at end of file
+#include <fcntl.h>
+#endif /* INCLUDED_ACTIVEMQ_SYSCALL_H */



Mime
View raw message