ACTIVEMQ6-1 Renaming native and 64/32 bit compilation

This commit is contained in:
Clebert 2015-04-27 12:28:34 -04:00 committed by Clebert Suconic
parent 9a6ae57d45
commit 08d62dccc0
11 changed files with 31 additions and 37 deletions

View File

@ -136,7 +136,7 @@ public class AsynchronousFileImpl implements AsynchronousFile
static
{
String[] libraries = new String[]{"activemqAIO", "activemqAIO64", "activemqAIO32", "activemqAIO_ia64"};
String[] libraries = new String[]{"artemis-native", "artemis-native-64", "artemis-native-32"};
for (String library : libraries)
{

View File

@ -37,7 +37,7 @@ if you are missing any dependencies, autoconf would tell you what you're missing
COMPILED FILE
The produced file will be under the ./target/nar (example: ./target/nar/activemq-native-6.0.0-amd64-Linux-gpp-jni/lib/amd64-Linux-gpp/jni/libactivemq-native-6.0.0.so)
The produced file will be under the ./target/nar (example: ./target/nar/artemis-native-6.0.0-amd64-Linux-gpp-jni/lib/amd64-Linux-gpp/jni/libartemis-native-6.0.0.so)
and you will have to rename it manually under ./bin following the appropriate pattern.

Binary file not shown.

Binary file not shown.

View File

@ -56,7 +56,7 @@
<resource>
<directory>bin/</directory>
<includes>
<include>libactivemqAIO32.so</include>
<include>libartemisAIO32.so</include>
</includes>
</resource>
</resources>
@ -74,7 +74,7 @@
<resource>
<directory>bin/</directory>
<includes>
<include>libactivemqAIO64.so</include>
<include>libartemisAIO64.so</include>
</includes>
</resource>
</resources>
@ -95,12 +95,6 @@
<build>
<plugins>
<plugin>
<!-- Not officially released into Central Maven yet,
for now you have to download the snapshot with
git clone https://github.com/maven-nar/nar-maven-plugin.git
cd nar-maven-plugin
mvn install
-->
<groupId>com.github.maven-nar</groupId>
<artifactId>nar-maven-plugin</artifactId>
<version>3.0.0</version>

View File

@ -25,7 +25,7 @@
#include <time.h>
#include <sys/file.h>
#include "org_apache_activemq_core_libaio_Native.h"
#include "org_apache_activemq_artemis_core_libaio_Native.h"
#include "JavaUtilities.h"
@ -52,7 +52,7 @@ inline AIOController * getController(JNIEnv *env, jobject & controllerAddress)
* Method: openFile
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_org_apache_activemq_core_libaio_Native_openFile
JNIEXPORT jint JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_openFile
(JNIEnv * env , jclass , jstring jstrFileName)
{
std::string fileName = convertJavaString(env, jstrFileName);
@ -65,7 +65,7 @@ JNIEXPORT jint JNICALL Java_org_apache_activemq_core_libaio_Native_openFile
* Method: closeFile
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_closeFile
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_closeFile
(JNIEnv * , jclass , jint handle)
{
close(handle);
@ -76,7 +76,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_closeFile
* Method: flock
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_org_apache_activemq_core_libaio_Native_flock
JNIEXPORT jboolean JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_flock
(JNIEnv * , jclass , jint handle)
{
return flock(handle, LOCK_EX | LOCK_NB) == 0;
@ -89,7 +89,7 @@ JNIEXPORT jboolean JNICALL Java_org_apache_activemq_core_libaio_Native_flock
* Method: init
* Signature: (Ljava/lang/String;Ljava/lang/Class;)J
*/
JNIEXPORT jobject JNICALL Java_org_apache_activemq_core_libaio_Native_init
JNIEXPORT jobject JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_init
(JNIEnv * env, jclass, jclass controllerClazz, jstring jstrFileName, jint maxIO, jobject logger)
{
AIOController * controller = 0;
@ -98,14 +98,14 @@ JNIEXPORT jobject JNICALL Java_org_apache_activemq_core_libaio_Native_init
std::string fileName = convertJavaString(env, jstrFileName);
controller = new AIOController(fileName, (int) maxIO);
controller->done = env->GetMethodID(controllerClazz,"callbackDone","(Lorg/apache/activemq/core/asyncio/AIOCallback;JLjava/nio/ByteBuffer;)V");
controller->done = env->GetMethodID(controllerClazz,"callbackDone","(Lorg/apache/activemq/artemis/core/asyncio/AIOCallback;JLjava/nio/ByteBuffer;)V");
if (!controller->done)
{
throwException (env, -1, "can't get callbackDone method");
return 0;
}
controller->error = env->GetMethodID(controllerClazz, "callbackError", "(Lorg/apache/activemq/core/asyncio/AIOCallback;JLjava/nio/ByteBuffer;ILjava/lang/String;)V");
controller->error = env->GetMethodID(controllerClazz, "callbackError", "(Lorg/apache/activemq/artemis/core/asyncio/AIOCallback;JLjava/nio/ByteBuffer;ILjava/lang/String;)V");
if (!controller->done)
{
throwException (env, -1, "can't get callbackError method");
@ -137,7 +137,7 @@ JNIEXPORT jobject JNICALL Java_org_apache_activemq_core_libaio_Native_init
* objThis here is passed as a parameter at the java layer. It used to be a JNI this and now it's a java static method
where the intended reference is now passed as an argument
*/
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_read
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_read
(JNIEnv *env, jclass, jobject objThis, jobject controllerAddress, jlong position, jlong size, jobject jbuffer, jobject callback)
{
try
@ -169,7 +169,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_read
// Fast memset on buffer
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_resetBuffer
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_resetBuffer
(JNIEnv *env, jclass, jobject jbuffer, jint size)
{
void * buffer = env->GetDirectBufferAddress(jbuffer);
@ -184,7 +184,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_resetBuffer
}
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_destroyBuffer
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_destroyBuffer
(JNIEnv * env, jclass, jobject jbuffer)
{
if (jbuffer == 0)
@ -196,7 +196,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_destroyBuffer
free(buffer);
}
JNIEXPORT jobject JNICALL Java_org_apache_activemq_core_libaio_Native_newNativeBuffer
JNIEXPORT jobject JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_newNativeBuffer
(JNIEnv * env, jclass, jlong size)
{
try
@ -234,7 +234,7 @@ JNIEXPORT jobject JNICALL Java_org_apache_activemq_core_libaio_Native_newNativeB
* objThis here is passed as a parameter at the java layer. It used to be a JNI this and now it's a java static method
where the intended reference is now passed as an argument
*/
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_write
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_write
(JNIEnv *env, jclass, jobject objThis, jobject controllerAddress, jlong sequence, jlong position, jlong size, jobject jbuffer, jobject callback)
{
try
@ -259,7 +259,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_write
}
}
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_writeInternal
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_writeInternal
(JNIEnv * env, jclass, jobject controllerAddress, jlong positionToWrite, jlong size, jobject jbuffer)
{
try
@ -282,7 +282,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_writeInternal
}
JNIEXPORT void Java_org_apache_activemq_core_libaio_Native_internalPollEvents
JNIEXPORT void Java_org_apache_activemq_artemis_core_libaio_Native_internalPollEvents
(JNIEnv *env, jclass, jobject controllerAddress)
{
try
@ -296,7 +296,7 @@ JNIEXPORT void Java_org_apache_activemq_core_libaio_Native_internalPollEvents
}
}
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_stopPoller
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_stopPoller
(JNIEnv *env, jclass, jobject controllerAddress)
{
try
@ -310,7 +310,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_stopPoller
}
}
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_closeInternal
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_closeInternal
(JNIEnv *env, jclass, jobject controllerAddress)
{
try
@ -326,7 +326,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_closeInternal
}
JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_fill
JNIEXPORT void JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_fill
(JNIEnv * env, jclass, jobject controllerAddress, jlong position, jint blocks, jlong size, jbyte fillChar)
{
try
@ -345,7 +345,7 @@ JNIEXPORT void JNICALL Java_org_apache_activemq_core_libaio_Native_fill
/** It does nothing... just return true to make sure it has all the binary dependencies */
JNIEXPORT jint JNICALL Java_org_apache_activemq_core_libaio_Native_getNativeVersion
JNIEXPORT jint JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_getNativeVersion
(JNIEnv *, jclass)
{
@ -353,7 +353,7 @@ JNIEXPORT jint JNICALL Java_org_apache_activemq_core_libaio_Native_getNativeVers
}
JNIEXPORT jlong JNICALL Java_org_apache_activemq_core_libaio_Native_size0
JNIEXPORT jlong JNICALL Java_org_apache_activemq_artemis_core_libaio_Native_size0
(JNIEnv * env, jclass, jobject controllerAddress)
{
try

View File

@ -30,7 +30,7 @@ void throwRuntimeException(JNIEnv * env, const char * message)
void throwException(JNIEnv * env, const int code, const char * message)
{
jclass exceptionClass = env->FindClass("org/apache/activemq/api/core/ActiveMQException");
jclass exceptionClass = env->FindClass("org/apache/activemq/artemis/api/core/ActiveMQException");
if (exceptionClass==NULL)
{
std::cerr << "Couldn't throw exception message:= " << message << "\n";

View File

@ -65,25 +65,25 @@ Or on Debian systems:
## Invoking the compilation
In the source distribution or git clone, in the `activemq-native` directory, execute the shell
In the source distribution or git clone, in the `artemis-native` directory, execute the shell
script `compile-native.sh`. This script will invoke the proper maven profile to perform the native build.
someUser@someBox:/checkout-dir/activemq-native$ ./compile-native.sh
someUser@someBox:/checkout-dir/artemis-native$ ./compile-native.sh
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ActiveMQ Artemis Native POM 6.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- nar-maven-plugin:3.0.0:nar-validate (default-nar-validate) @ activemq-native ---
[INFO] --- nar-maven-plugin:3.0.0:nar-validate (default-nar-validate) @ artemis-native ---
[INFO] Using AOL: amd64-Linux-gpp
[INFO]
[INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ activemq-native ---
[INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-java) @ artemis-native ---
...
The produced library will be at
`./target/nar/activemq-native-RELEASE-amd64-Linux-gpp-jni/lib/amd64-Linux-gpp/jni/
libactivemq-native-RELEASE.so`. Simply move that file over
`./target/nar/artemis-native-RELEASE-amd64-Linux-gpp-jni/lib/amd64-Linux-gpp/jni/
libartemis-native-RELEASE.so`. Simply move that file over
`bin` with the proper rename [library
path](#using-server.library.path).

View File

@ -95,7 +95,7 @@
<activemq-surefire-argline>-Djava.util.logging.manager=org.jboss.logmanager.LogManager
-Dlogging.configuration=file:${activemq.basedir}/tests/config/logging.properties
-Djava.library.path=${activemq.basedir}/activemq-native/bin/ -Djgroups.bind_addr=localhost
-Djava.library.path=${activemq.basedir}/artemis-native/bin/ -Djgroups.bind_addr=localhost
-Djava.net.preferIPv4Stack=true
</activemq-surefire-argline>
<activemq.basedir>${project.basedir}</activemq.basedir>