From: Francois Chouinard Date: Thu, 15 Mar 2012 02:26:28 +0000 (-0500) Subject: Internalize lttng.jni X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ce38c104428ab10d93d5d3ac5a44e4ef86c9dd6f;p=deliverable%2Ftracecompass.git Internalize lttng.jni --- diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/headless/JniTraceTest.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/headless/JniTraceTest.java index 5fc59c6cc4..4fea922811 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/headless/JniTraceTest.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/headless/JniTraceTest.java @@ -12,10 +12,11 @@ package org.eclipse.linuxtools.lttng.core.tests.headless; *******************************************************************************/ import java.util.ArrayList; + +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniMarkerField; import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/Combinations.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/Combinations.java index a3b0c1a782..d31264ed12 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/Combinations.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/Combinations.java @@ -9,11 +9,11 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniMarker; import org.eclipse.linuxtools.lttng.jni.JniMarkerField; import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniEventTest.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniEventTest.java index 0ef45dc516..7d3815ec59 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniEventTest.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniEventTest.java @@ -33,10 +33,10 @@ package org.eclipse.linuxtools.lttng.core.tests.jni; import junit.framework.TestCase; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; @SuppressWarnings("nls") diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerFieldTest.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerFieldTest.java index 569fdfeb21..e6b0a6fe46 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerFieldTest.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerFieldTest.java @@ -4,10 +4,10 @@ package org.eclipse.linuxtools.lttng.core.tests.jni; import junit.framework.TestCase; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniMarker; import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; /* diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerTest.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerTest.java index 927c9c70a4..30aed0b6a3 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerTest.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniMarkerTest.java @@ -4,9 +4,9 @@ package org.eclipse.linuxtools.lttng.core.tests.jni; import junit.framework.TestCase; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; /* diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTraceTest.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTraceTest.java index af59fd7d80..c4606eb194 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTraceTest.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTraceTest.java @@ -1,9 +1,9 @@ package org.eclipse.linuxtools.lttng.core.tests.jni; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; import junit.framework.TestCase; diff --git a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTracefileTest.java b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTracefileTest.java index bdd7adf728..e9fc45fada 100644 --- a/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTracefileTest.java +++ b/org.eclipse.linuxtools.lttng.core.tests/src/org/eclipse/linuxtools/lttng/core/tests/jni/JniTracefileTest.java @@ -3,10 +3,10 @@ package org.eclipse.linuxtools.lttng.core.tests.jni; import junit.framework.TestCase; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniTrace; import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; /* diff --git a/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java b/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java index c6adf10a21..fae7b95305 100644 --- a/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java +++ b/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTrace.java @@ -27,12 +27,12 @@ import org.eclipse.linuxtools.internal.lttng.core.event.LttngLocation; import org.eclipse.linuxtools.internal.lttng.core.event.LttngTimestamp; import org.eclipse.linuxtools.internal.lttng.core.exceptions.LttngException; import org.eclipse.linuxtools.internal.lttng.core.tracecontrol.utility.LiveTraceManager; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.JniEvent; import org.eclipse.linuxtools.lttng.jni.JniMarker; import org.eclipse.linuxtools.lttng.jni.JniTrace; import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceFactory; import org.eclipse.linuxtools.tmf.core.event.ITmfTimestamp; import org.eclipse.linuxtools.tmf.core.event.TmfEvent; diff --git a/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTraceVersion.java b/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTraceVersion.java index 3f83b14da7..06b825b618 100644 --- a/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTraceVersion.java +++ b/org.eclipse.linuxtools.lttng.core/src/org/eclipse/linuxtools/internal/lttng/core/trace/LTTngTraceVersion.java @@ -13,7 +13,7 @@ package org.eclipse.linuxtools.internal.lttng.core.trace; *******************************************************************************/ import org.eclipse.linuxtools.internal.lttng.core.exceptions.LttngException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTraceVersionException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTraceVersionException; import org.eclipse.linuxtools.lttng.jni.factory.JniTraceVersion; /** diff --git a/org.eclipse.linuxtools.lttng.jni/META-INF/MANIFEST.MF b/org.eclipse.linuxtools.lttng.jni/META-INF/MANIFEST.MF index 4c22dcfcfc..c0b35c804a 100644 --- a/org.eclipse.linuxtools.lttng.jni/META-INF/MANIFEST.MF +++ b/org.eclipse.linuxtools.lttng.jni/META-INF/MANIFEST.MF @@ -4,12 +4,12 @@ Bundle-Name: %Bundle-Name Bundle-SymbolicName: org.eclipse.linuxtools.lttng.jni Bundle-Version: 0.5.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.eclipse.linuxtools.lttng.jni, - org.eclipse.linuxtools.lttng.jni.common, - org.eclipse.linuxtools.lttng.jni.exception, - org.eclipse.linuxtools.lttng.jni.factory, - org.eclipse.linuxtools.lttng.jni_v2_3, - org.eclipse.linuxtools.lttng.jni_v2_5 +Export-Package: org.eclipse.linuxtools.internal.lttng.jni.common;x-friends:="org.eclipse.linuxtools.lttng.core,org.eclipse.linuxtools.lttng.core.tests", + org.eclipse.linuxtools.internal.lttng.jni.exception;x-friends:="org.eclipse.linuxtools.lttng.core,org.eclipse.linuxtools.lttng.core.tests", + org.eclipse.linuxtools.internal.lttng.jni_v2_3;x-internal:=true, + org.eclipse.linuxtools.internal.lttng.jni_v2_5;x-internal:=true, + org.eclipse.linuxtools.lttng.jni;x-friends:="org.eclipse.linuxtools.lttng.core,org.eclipse.linuxtools.lttng.core.tests", + org.eclipse.linuxtools.lttng.jni.factory;x-friends:="org.eclipse.linuxtools.lttng.core,org.eclipse.linuxtools.lttng.core.tests" Bundle-Localization: plugin Bundle-Vendor: %Bundle-Vendor Require-Bundle: org.eclipse.core.runtime diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/JniTime.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/JniTime.java new file mode 100644 index 0000000000..0b649aa155 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/JniTime.java @@ -0,0 +1,213 @@ +package org.eclipse.linuxtools.internal.lttng.jni.common; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniTime + *

+ * Used to store (event, trace, tracefile, ...) timestamp. + * + * Mimic the behavior of the LttTime C structure. + */ +public class JniTime extends Jni_C_Constant implements Comparable +{ + private long time = 0; + + /** + * Default constructor.

+ * + * Note : Time will be set to 0. + * + */ + public JniTime() { + time = 0; + } + + /** + * Copy constructor. + * + * @param oldTime Reference to the JniTime you want to copy. + */ + public JniTime(JniTime oldTime) { + time = oldTime.getTime(); + } + + /** + * Constructor with parameters.

+ * + * "LTT style" constructor with Seconds et Nanoseconds + * + * @param newSec Seconds of the JniTime + * @param newNanoSec Nanoseconds of the JniTime + */ + public JniTime(long newSec, long newNanoSec) { + time = (newSec * NANO) + newNanoSec; + } + + /** + * Constructor with parameters.

+ * + * Usual "nanosecond only" constructor. + * + * @param newNanoSecTime Time in nanoseconds + */ + public JniTime(long newNanoSecTime) { + time = newNanoSecTime; + } + + /** + * Second of the time.

+ * + * Returns seconds, i.e. multiple of 1 000 000, of the stored nanoseconds time. + * + * @return Second of this time. + */ + public long getSeconds() { + return (time / NANO); + } + + /** + * Getter for the nanosecond of the time.

+ * + * Returns nanoseconds part, i.e. modulo of 1 000 000, of the stored nanoseconds time. + * + * @return Nanoseconds of this time + */ + public long getNanoSeconds() { + return time % NANO; + } + + /** + * Full time, in nanoseconds.

+ * + * @return Complete time in nanoseconds + */ + public long getTime() { + return time; + } + + /** + * Changes the current time for this object

+ * + * @param newTime New time to set, in nanoseconds. + */ + public void setTime(long newTime) { + time = newTime; + } + + /* + * Populate this time object + * + * Note: This function is called from C side. + * + * @param newTime The time we want to populate + */ + @SuppressWarnings("unused") + private void setTimeFromC(long newTime) { + time = newTime; + } + + /** + * Comparaison operator smaller or equal than "<=" .

+ * + * @param comparedTime The time we want to compare with this one + * + * @return true if compared time is smaller or equal, false otherwise + */ + public boolean isSmallerOrEqual(JniTime comparedTime) { + + // NOTE : We check <= instead of just < + // This mean the LEFT OPERAND (comparedTime) always prevails + if (this.getTime() <= comparedTime.getTime() ) { + return true; + } + else { + return false; + } + } + + /** + * compareTo operator.

+ * + * @param right The time we want to compare with this one + * + * @return int of value -1, 0 or 1, as the pased argument is bigger, equal or smaller than this time + */ + @Override + public int compareTo(JniTime right) { + long leftTime = this.getTime(); + long rightTime = right.getTime(); + + if ( leftTime < rightTime ) { + return -1; + } + else if ( leftTime > rightTime ) { + return 1; + } + else { + return 0; + } + } + + /** + * faster equals since it is called very often + * @param other the object to the right of this + * @return true if the times are the same, false otherwise. + */ + public boolean equals(JniTime other) { + return ((other != null) && (this.time == other.time)); + } + + /** + * Overridden equals for JniTime type + * + * @param The object we want to compare too + * + * @return true if the time is the same, false otherwise. + */ + @Override + public boolean equals(Object obj) { + if (obj instanceof JniTime) { + return (((JniTime) obj).time == this.time); + } + return false; + } + + /** + * Overridden hash code for JniTime type + * + */ + @Override + public int hashCode() { + return this.toString().hashCode(); + } + + + /** + * toString() method. + * Intended to debug

+ * + * NOTE : We output the time in the same format as LTT (seconds and nanosecond separatly) + * + * @return String Attributes of the object concatenated in String + */ + @Override + @SuppressWarnings("nls") + public String toString() { + String returnData = ""; + + returnData += "seconds : " + this.getSeconds() + "\n"; + returnData += "nanoSeconds : " + this.getNanoSeconds() + "\n"; + + return returnData; + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Constant.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Constant.java new file mode 100644 index 0000000000..932c58942d --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Constant.java @@ -0,0 +1,51 @@ +package org.eclipse.linuxtools.internal.lttng.jni.common; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * Jni_C_Common + *

+ * Common constants and methods that should be shared between JNI objects.

+ * + * This class is abstract and is intended to be extended by LTTng modules that need the constants. + */ +public abstract class Jni_C_Constant { + + // Needed for native types + public static final int NULL = 0; + + // C errno correspondance. Used to interpret LTT return value + public static final int EOK = 0; + public static final int EPERM = 1; + public static final int ERANGE = 34; + + // Timestamps are in nanoseconds, this const ease up the math + public static final long NANO = 1000000000; + + /** + * Default constructor + */ + public Jni_C_Constant() { + } + + /** + * "Alternate" .toString()

+ * + * Simulates the way Java Object implements "toString()" + * + * @return The Java hashed UID of the object (i.e. : NAME@HASH) + */ + @SuppressWarnings("nls") + public String getReferenceToString() { + return this.getClass().getName() + "@" + Integer.toHexString(this.hashCode()); + } +} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Pointer.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Pointer.java new file mode 100644 index 0000000000..c0bae4e383 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Pointer.java @@ -0,0 +1,105 @@ +package org.eclipse.linuxtools.internal.lttng.jni.common; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * Jni_C_Pointer + *

+ * Class pointer to handle properly "C pointer"

+ * + * Can transparently handle pointer of 32 or 64 bits. + */ +public class Jni_C_Pointer extends Jni_C_Constant { + + protected long ptr = NULL; + protected boolean isLong = true; + + /** + * Default constructor.

+ * + * Note : Pointer will be set to a 64bits "NULL". + */ + public Jni_C_Pointer() { + ptr = NULL; + } + + /** + * Constructor with parameters for 64bits pointers. + * + * @param newPtr long-converted (64 bits) C pointer. + */ + public Jni_C_Pointer(long newPtr) { + ptr = newPtr; + isLong = true; + } + + /** + * Constructor with parameters for 32bits pointers. + * + * @param newPtr int-converted (32 bits) C pointer. + */ + public Jni_C_Pointer(int newPtr) { + ptr = (long)newPtr; + isLong = false; + } + + /** + * Get the current pointer. + * + * @return The current pointer, in long. + */ + public long getPointer() { + return ptr; + } + + /** + * Set the pointer, as a 64bits pointer. + * + * @param newPtr long-converted (64 bits) C pointer. + */ + public void setPointer(long newPtr) { + ptr = newPtr; + isLong = true; + } + + /** + * Set the pointer, as a 64bits pointer. + * + * @param newPtr int-converted (32 bits) C pointer. + */ + public void setPointer(int newPtr) { + ptr = newPtr; + isLong = false; + } + + /** + * toString() method.

+ * + * Convert the pointer to a nice looking int/long hexadecimal format. + * + * @return Attributes of the object concatenated in String + */ + @Override + @SuppressWarnings("nls") + public String toString() { + String returnData = "0x"; + + if (isLong == true) { + returnData += Long.toHexString(ptr); + } + else { + returnData += Integer.toHexString((int) ptr); + } + + return returnData; + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Pointer_And_Library_Id.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Pointer_And_Library_Id.java new file mode 100644 index 0000000000..ab00652ae5 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/common/Jni_C_Pointer_And_Library_Id.java @@ -0,0 +1,71 @@ +package org.eclipse.linuxtools.internal.lttng.jni.common; + +public class Jni_C_Pointer_And_Library_Id extends Jni_C_Pointer { + + // *** Library Id + // Needed to know which library we need to make our functions call in case several are loaded + // This make possible to use several different trace version at the same time + private int libraryId = -1; + + /** + * Default constructor.

+ * + * Note : Pointer will be set to a 64bits "NULL" and Id -1. + */ + public Jni_C_Pointer_And_Library_Id() { + super(); + libraryId = -1; + } + + /** + * Constructor with parameters for 64bits pointers and library handle id. + * + * @param newPtr long-converted (64 bits) C pointer. + * @param newHandle a valid library id as int + */ + public Jni_C_Pointer_And_Library_Id(int newId, long newPtr) { + super(newPtr); + libraryId = newId; + } + + /** + * Constructor with parameters for 32bits pointers and library handle id. + * + * @param newPtr int-converted (32 bits) C pointer. + * @param newHandle a valid library id as int + */ + public Jni_C_Pointer_And_Library_Id(int newId, int newPtr) { + super(newPtr); + libraryId = newId; + } + + /** + * Copy constructor.

+ * + * @param oldPointerAndId The old object to copy from. + */ + public Jni_C_Pointer_And_Library_Id(Jni_C_Pointer_And_Library_Id oldPointerAndId) { + super(oldPointerAndId.ptr); + libraryId = oldPointerAndId.libraryId; + } + + /** + * Get the library handle id currently in use.

+ * Id is used to tell the C which version of the functions to call.

+ * + * @return The current id + */ + public int getLibraryId() { + return libraryId; + } + + /** + * Set a new library id.

+ * Id is used to tell the C which version of the functions to call.

+ * + * @param newHandleId The new Id to use (must be a valid id for the C library). + */ + public void setLibraryId(int newId) { + this.libraryId = newId; + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniEventException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniEventException.java new file mode 100644 index 0000000000..09e1f07ce2 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniEventException.java @@ -0,0 +1,25 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniEventException + *

+ * Basic exception class for the JniEvent class + */ +public class JniEventException extends JniException { + private static final long serialVersionUID = -5891749130387304519L; + + public JniEventException(String errMsg) { + super(errMsg); + } +} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniEventOutOfRangeException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniEventOutOfRangeException.java new file mode 100644 index 0000000000..d868cb2e07 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniEventOutOfRangeException.java @@ -0,0 +1,28 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniEventOutOfRangeException + *

+ * Sub-exception type for the JniEventException type + * This exception type will get thrown when there is no more event of this type + * available + */ +public class JniEventOutOfRangeException extends JniEventException { + private static final long serialVersionUID = -4645877232795324541L; + + public JniEventOutOfRangeException(String errMsg) { + super(errMsg); + } +} + diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniException.java new file mode 100644 index 0000000000..a556fcdd53 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniException.java @@ -0,0 +1,27 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + + +/** + * JniException + *

+ * Super class for JNI exception. + */ +public class JniException extends Exception { + private static final long serialVersionUID = -6620784221853154537L; + + public JniException(String errMsg) { + super(errMsg); + } +} + diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniMarkerException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniMarkerException.java new file mode 100644 index 0000000000..9158b32365 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniMarkerException.java @@ -0,0 +1,25 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniMarkerException + *

+ * Basic Exception class for the JniMarker class + */ +public class JniMarkerException extends JniException { + private static final long serialVersionUID = -4694173610721983794L; + + public JniMarkerException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniMarkerFieldException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniMarkerFieldException.java new file mode 100644 index 0000000000..5d59c83393 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniMarkerFieldException.java @@ -0,0 +1,25 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniMarkerFieldException + *

+ * Basic Exception class for the JniMarkerField class + */ +public class JniMarkerFieldException extends JniException { + private static final long serialVersionUID = 6066381741374806879L; + + public JniMarkerFieldException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniNoNextEventInTraceException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniNoNextEventInTraceException.java new file mode 100644 index 0000000000..547d0c4af1 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniNoNextEventInTraceException.java @@ -0,0 +1,28 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniNoNextEventInTraceException + *

+ * Sub-exception class type for JniTraceException + * This type will get thrown when we can't find any "next" event + * This should usually mean there is no more event in the trace + + */ +public class JniNoNextEventInTraceException extends JniTraceException { + private static final long serialVersionUID = -2887528566100063849L; + + public JniNoNextEventInTraceException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniNoSuchEventException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniNoSuchEventException.java new file mode 100644 index 0000000000..e0e081f2d8 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniNoSuchEventException.java @@ -0,0 +1,28 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniNoSuchEventException + *

+ * Sub-exception type for the JniEventException type + * This exception type will get thrown when an event is unavailable + * This might happen at construction because some events type are not present in + * the trace + */ +public class JniNoSuchEventException extends JniEventException { + private static final long serialVersionUID = -4379712949891538051L; + + public JniNoSuchEventException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniOpenTraceFailedException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniOpenTraceFailedException.java new file mode 100644 index 0000000000..0d6b1f60cc --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniOpenTraceFailedException.java @@ -0,0 +1,27 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniOpenTraceFailedException + *

+ * Sub-exception class type for JniTraceException + * This type will get thrown when a trace fail to open + * Most likely to be caused by a bad tracepath + */ +public class JniOpenTraceFailedException extends JniTraceException { + private static final long serialVersionUID = 877769692366394895L; + + public JniOpenTraceFailedException(String errMsg) { + super(errMsg); + } +} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTraceException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTraceException.java new file mode 100644 index 0000000000..5375a6151b --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTraceException.java @@ -0,0 +1,25 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniTraceException + *

+ * Basic exception class for the JniTrace class + */ +public class JniTraceException extends JniException { + private static final long serialVersionUID = -6873007333085268143L; + + public JniTraceException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTraceVersionException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTraceVersionException.java new file mode 100644 index 0000000000..c36c04f014 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTraceVersionException.java @@ -0,0 +1,25 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniTraceVersionException + *

+ * Basic exception class for the JniTraceVersion class + */ +public class JniTraceVersionException extends JniException { + private static final long serialVersionUID = -5891749123457304519L; + + public JniTraceVersionException(String errMsg) { + super(errMsg); + } +} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTracefileException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTracefileException.java new file mode 100644 index 0000000000..71661fe69b --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTracefileException.java @@ -0,0 +1,25 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniTracefileException + *

+ * Basic exception class for the JniTracefile class + */ +public class JniTracefileException extends JniException { + private static final long serialVersionUID = 5081317864491800084L; + + public JniTracefileException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTracefileWithoutEventException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTracefileWithoutEventException.java new file mode 100644 index 0000000000..a555c98cd6 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni/exception/JniTracefileWithoutEventException.java @@ -0,0 +1,27 @@ +package org.eclipse.linuxtools.internal.lttng.jni.exception; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +/** + * JniTracefileWithoutEventException + *

+ * Sub-exception class type for JniTracefileException + * This type will get thrown when a trace file contain no readable events + * The proper course of action would usually be to ignore this useless trace file + */ +public class JniTracefileWithoutEventException extends JniTracefileException { + private static final long serialVersionUID = -8183967479236071261L; + + public JniTracefileWithoutEventException(String errMsg) { + super(errMsg); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniEvent_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniEvent_v2_3.java new file mode 100644 index 0000000000..cddef41df8 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniEvent_v2_3.java @@ -0,0 +1,46 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_3; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import java.util.HashMap; + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniEvent; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniEvent_v2_3 + *

+ * JniEvent version to support Lttng traceformat of version 2.3
+ * This class extend abstract class JniEvent with (possibly) version specific implementation.
+ *

+ */ +public class JniEvent_v2_3 extends JniEvent { + + /* + * Forbid access to the default constructor + */ + protected JniEvent_v2_3() { + super(); + } + + public JniEvent_v2_3(JniEvent_v2_3 oldEvent) { + super(oldEvent); + } + + public JniEvent_v2_3(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + super(newEventPtr, newMarkersMap, newParentTracefile); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniMarkerField_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniMarkerField_v2_3.java new file mode 100644 index 0000000000..56d4332702 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniMarkerField_v2_3.java @@ -0,0 +1,42 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_3; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniMarkerField; + +/** + * JniMarkerField_v2_3 + *

+ * JniMarkerField version to support Lttng traceformat of version 2.3
+ * This class extend abstract class JniMarkerField with (possibly) version specific implementation.
+ *

+ */ +public class JniMarkerField_v2_3 extends JniMarkerField { + + /* + * Forbid access to the default constructor + */ + protected JniMarkerField_v2_3() { + super(); + } + + + public JniMarkerField_v2_3(JniMarkerField_v2_3 oldMarkerField) { + super(oldMarkerField); + } + + public JniMarkerField_v2_3(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { + super(newMarkerFieldPtr); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniMarker_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniMarker_v2_3.java new file mode 100644 index 0000000000..080892a7e8 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniMarker_v2_3.java @@ -0,0 +1,59 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_3; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniMarkerField; + +/** + * JniMarker_v2_3 + *

+ * JniMarker version to support Lttng traceformat of version 2.3
+ * This class extend abstract class JniMarker with (possibly) version specific implementation.
+ *

+ */ +public class JniMarker_v2_3 extends JniMarker { + + /* + * Forbid access to the default constructor + */ + protected JniMarker_v2_3() { + super(); + } + + + public JniMarker_v2_3(JniMarker_v2_3 oldMarker) { + super(oldMarker); + } + + public JniMarker_v2_3(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { + super(newMarkerPtr); + } + + + /** + * Allocate (call constructor for) a new JniMarkerField.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniMarker + * + * @return JniMarkerField a newly allocated JniMarkerField + * + * @see org.eclipse.linuxtools.lttng.jni.JniMarker + */ + @Override + public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { + return new JniMarkerField_v2_3(newMarkerFieldPtr); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniParser_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniParser_v2_3.java new file mode 100644 index 0000000000..710137ede5 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniParser_v2_3.java @@ -0,0 +1,31 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_3; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.lttng.jni.JniParser; + +/** + * JniParser_v2_3 + *

+ * JniParser version to support Lttng traceformat of version 2.3
+ * This class extend abstract class JniParser with (possibly) version specific implementation.
+ *

+ */ +public class JniParser_v2_3 extends JniParser { + + /* + * Forbid access to the default constructor + */ + protected JniParser_v2_3() { + super(); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniTrace_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniTrace_v2_3.java new file mode 100644 index 0000000000..b0058224e3 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniTrace_v2_3.java @@ -0,0 +1,89 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_3; +/******************************************************************************* + * Copyright (c) 2009, 2011 Ericsson, MontaVista Software + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path + * Yufen Kuo (ykuo@mvista.com) - bug 340341: handle gracefully when native library failed to initialize + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniTrace; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniTrace_v2_3 + *

+ * JniTrace version to support Lttng traceformat of version 2.3.
+ * This class extend abstract class JniTrace with (possibly) version specific implementation.
+ * + * It also make sure the correct library is loaded by liblttvlibraryloader.so + *

+ */ +public class JniTrace_v2_3 extends JniTrace { + + // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load. + // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path. + // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. + private static final String LIBRARY_NAME = "liblttvtraceread-2.3.so"; //$NON-NLS-1$ + + /* + * Forbid access to the default constructor + */ + protected JniTrace_v2_3() { + super(); + } + + + public JniTrace_v2_3(String newpath) throws JniException { + super(newpath); + } + + public JniTrace_v2_3(String newpath, boolean newPrintDebug) throws JniException { + super(newpath, newPrintDebug); + } + + + public JniTrace_v2_3(JniTrace_v2_3 oldTrace) { + super(oldTrace); + } + + public JniTrace_v2_3(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { + super(newPtr, newPrintDebug); + } + + /** + * Get the trace library name + *

+ * + * Get the version specific native trace library name + * + * @return The native trace library name + */ + @Override + public String getTraceLibName() { + return LIBRARY_NAME; + } + + /** + * Allocate (call constructor for) a new JniTracefile.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTrace + * + * @return JniTracefile a newly allocated JniTracefile + * + * @see org.eclipse.linuxtools.lttng.jni.JniTrace + */ + @Override + public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + return new JniTracefile_v2_3(newPtr, newParentTrace); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniTracefile_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniTracefile_v2_3.java new file mode 100644 index 0000000000..2b62e15039 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_3/JniTracefile_v2_3.java @@ -0,0 +1,77 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_3; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import java.util.HashMap; + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniEvent; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniTrace; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniTracefile_v2_3 + *

+ * JniTracefile version to support Lttng traceformat of version 2.3
+ * This class extend abstract class JniTracefile with (possibly) version specific implementation.
+ *

+ */ +public class JniTracefile_v2_3 extends JniTracefile { + + /* + * Forbid access to the default constructor + */ + protected JniTracefile_v2_3() { + super(); + } + + + public JniTracefile_v2_3(JniTracefile_v2_3 oldTracefile) { + super(oldTracefile); + } + + public JniTracefile_v2_3(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + super(newPtr, newParentTrace); + } + + + /** + * Allocate (call constructor for) a new JniEvent.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTracefile + * + * @return JniEvent a newly allocated JniEvent + * + * @see org.eclipse.linuxtools.lttng.jni.JniTracefile + */ + @Override + public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + return new JniEvent_v2_3(newEventPtr, newMarkersMap, newParentTracefile); + } + + + /** + * Allocate (call constructor for) a new JniMarker.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTracefile + * + * @return JniMarker a newly allocated JniMarker + * + * @see org.eclipse.linuxtools.lttng.jni.JniTracefile + */ + @Override + public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { + return new JniMarker_v2_3(newMarkerPtr); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniEvent_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniEvent_v2_5.java new file mode 100644 index 0000000000..414a573600 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniEvent_v2_5.java @@ -0,0 +1,46 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_5; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import java.util.HashMap; + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniEvent; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniEvent_v2_5 + *

+ * JniEvent version to support Lttng traceformat of version 2.5
+ * This class extend abstract class JniEvent with (possibly) version specific implementation.
+ *

+ */ +public class JniEvent_v2_5 extends JniEvent { + + /* + * Forbid access to the default constructor + */ + protected JniEvent_v2_5() { + super(); + } + + public JniEvent_v2_5(JniEvent_v2_5 oldEvent) { + super(oldEvent); + } + + public JniEvent_v2_5(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + super(newEventPtr, newMarkersMap, newParentTracefile); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniMarkerField_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniMarkerField_v2_5.java new file mode 100644 index 0000000000..5d089cb335 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniMarkerField_v2_5.java @@ -0,0 +1,42 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_5; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniMarkerField; + +/** + * JniMarkerField_v2_5 + *

+ * JniMarkerField version to support Lttng traceformat of version 2.5
+ * This class extend abstract class JniMarkerField with (possibly) version specific implementation.
+ *

+ */ +public class JniMarkerField_v2_5 extends JniMarkerField { + + /* + * Forbid access to the default constructor + */ + protected JniMarkerField_v2_5() { + super(); + } + + + public JniMarkerField_v2_5(JniMarkerField_v2_5 oldMarkerField) { + super(oldMarkerField); + } + + public JniMarkerField_v2_5(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { + super(newMarkerFieldPtr); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniMarker_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniMarker_v2_5.java new file mode 100644 index 0000000000..90cd806d7c --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniMarker_v2_5.java @@ -0,0 +1,59 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_5; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniMarkerField; + +/** + * JniMarker_v2_5 + *

+ * JniMarker version to support Lttng traceformat of version 2.5
+ * This class extend abstract class JniMarker with (possibly) version specific implementation.
+ *

+ */ +public class JniMarker_v2_5 extends JniMarker { + + /* + * Forbid access to the default constructor + */ + protected JniMarker_v2_5() { + super(); + } + + + public JniMarker_v2_5(JniMarker_v2_5 oldMarker) { + super(oldMarker); + } + + public JniMarker_v2_5(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { + super(newMarkerPtr); + } + + + /** + * Allocate (call constructor for) a new JniMarkerField.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniMarker + * + * @return JniMarkerField a newly allocated JniMarkerField + * + * @see org.eclipse.linuxtools.lttng.jni.JniMarker + */ + @Override + public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { + return new JniMarkerField_v2_5(newMarkerFieldPtr); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniParser_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniParser_v2_5.java new file mode 100644 index 0000000000..3e8c9f99e7 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniParser_v2_5.java @@ -0,0 +1,31 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_5; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.lttng.jni.JniParser; + +/** + * JniParser_v2_5 + *

+ * JniParser version to support Lttng traceformat of version 2.5
+ * This class extend abstract class JniParser with (possibly) version specific implementation.
+ *

+ */ +public class JniParser_v2_5 extends JniParser { + + /* + * Forbid access to the default constructor + */ + protected JniParser_v2_5() { + super(); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniTrace_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniTrace_v2_5.java new file mode 100644 index 0000000000..6b78942996 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniTrace_v2_5.java @@ -0,0 +1,92 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_5; +/******************************************************************************* + * Copyright (c) 2009, 2011 Ericsson, MontaVista Software + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path + * Yufen Kuo (ykuo@mvista.com) - bug 340341: handle gracefully when native library failed to initialize + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniTrace; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniTrace_v2_5 + *

+ * JniTrace version to support Lttng traceformat of version 2.5.
+ * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).
+ * + * It also make sure the correct library is loaded by liblttvlibraryloader.so + *

+ */ +public class JniTrace_v2_5 extends JniTrace { + + // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load. + // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path. + // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. + private static final String LIBRARY_NAME = "liblttvtraceread-2.5.so"; //$NON-NLS-1$ + + /* + * Forbid access to the default constructor + */ + protected JniTrace_v2_5() { + super(); + } + + + public JniTrace_v2_5(String newpath) throws JniException { + super(newpath); + } + + public JniTrace_v2_5(String newpath, boolean newPrintDebug) throws JniException { + super(newpath, newPrintDebug); + } + + + public JniTrace_v2_5(JniTrace_v2_5 oldTrace) { + super(oldTrace); + } + + public JniTrace_v2_5(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { + super(newPtr, newPrintDebug); + } + + + /** + * Get the trace library name + *

+ * + * Get the version specific native trace library name + * + * @return The native trace library name + */ + @Override + public String getTraceLibName() { + return LIBRARY_NAME; + } + + /** + * Allocate (call constructor for) a new JniTracefile.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTrace + * + * @return JniTracefile a newly allocated JniTracefile + * + * @see org.eclipse.linuxtools.lttng.jni.JniTrace + */ + @Override + public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + return new JniTracefile_v2_5(newPtr, newParentTrace); + } + + + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniTracefile_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniTracefile_v2_5.java new file mode 100644 index 0000000000..7d712852cd --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_5/JniTracefile_v2_5.java @@ -0,0 +1,78 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_5; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import java.util.HashMap; + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniEvent; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniTrace; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniTracefile_v2_5 + *

+ * JniTracefile version to support Lttng traceformat of version 2.5
+ * This class extend abstract class JniTracefile with (possibly) version specific implementation.
+ *

+ */ +public class JniTracefile_v2_5 extends JniTracefile { + + /* + * Forbid access to the default constructor + */ + protected JniTracefile_v2_5() { + super(); + } + + + public JniTracefile_v2_5(JniTracefile_v2_5 oldTracefile) { + super(oldTracefile); + } + + public JniTracefile_v2_5(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + super(newPtr, newParentTrace); + } + + + /** + * Allocate (call constructor for) a new JniEvent.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTracefile + * + * @return JniEvent a newly allocated JniEvent + * + * @see org.eclipse.linuxtools.lttng.jni.JniTracefile + */ + @Override + public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + return new JniEvent_v2_5(newEventPtr, newMarkersMap, newParentTracefile); + } + + + /** + * Allocate (call constructor for) a new JniMarker.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTracefile + * + * @return JniMarker a newly allocated JniMarker + * + * @see org.eclipse.linuxtools.lttng.jni.JniTracefile + */ + @Override + public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { + return new JniMarker_v2_5(newMarkerPtr); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniEvent_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniEvent_v2_6.java new file mode 100644 index 0000000000..b7edd7ad68 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniEvent_v2_6.java @@ -0,0 +1,46 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_6; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import java.util.HashMap; + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniEvent; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniEvent_v2_6 + *

+ * JniEvent version to support Lttng traceformat of version 2.6
+ * This class extend abstract class JniEvent with (possibly) version specific implementation.
+ *

+ */ +public class JniEvent_v2_6 extends JniEvent { + + /* + * Forbid access to the default constructor + */ + protected JniEvent_v2_6() { + super(); + } + + public JniEvent_v2_6(JniEvent_v2_6 oldEvent) { + super(oldEvent); + } + + public JniEvent_v2_6(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + super(newEventPtr, newMarkersMap, newParentTracefile); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniMarkerField_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniMarkerField_v2_6.java new file mode 100644 index 0000000000..d7350a3ce8 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniMarkerField_v2_6.java @@ -0,0 +1,42 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_6; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniMarkerField; + +/** + * JniMarkerField_v2_6 + *

+ * JniMarkerField version to support Lttng traceformat of version 2.6
+ * This class extend abstract class JniMarkerField with (possibly) version specific implementation.
+ *

+ */ +public class JniMarkerField_v2_6 extends JniMarkerField { + + /* + * Forbid access to the default constructor + */ + protected JniMarkerField_v2_6() { + super(); + } + + + public JniMarkerField_v2_6(JniMarkerField_v2_6 oldMarkerField) { + super(oldMarkerField); + } + + public JniMarkerField_v2_6(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { + super(newMarkerFieldPtr); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniMarker_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniMarker_v2_6.java new file mode 100644 index 0000000000..1425230c19 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniMarker_v2_6.java @@ -0,0 +1,58 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_6; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniMarkerField; + +/** + * JniMarker_v2_6 + *

+ * JniMarker version to support Lttng traceformat of version 2.6
+ * This class extend abstract class JniMarker with (possibly) version specific implementation.
+ *

+ */ +public class JniMarker_v2_6 extends JniMarker { + + /* + * Forbid access to the default constructor + */ + protected JniMarker_v2_6() { + super(); + } + + + public JniMarker_v2_6(JniMarker_v2_6 oldMarker) { + super(oldMarker); + } + + public JniMarker_v2_6(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { + super(newMarkerPtr); + } + + + /** + * Allocate (call constructor for) a new JniMarkerField.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniMarker + * + * @return JniMarkerField a newly allocated JniMarkerField + * + * @see org.eclipse.linuxtools.lttng.jni.JniMarker + */ + @Override + public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { + return new JniMarkerField_v2_6(newMarkerFieldPtr); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniParser_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniParser_v2_6.java new file mode 100644 index 0000000000..939bf95d7d --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniParser_v2_6.java @@ -0,0 +1,31 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_6; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import org.eclipse.linuxtools.lttng.jni.JniParser; + +/** + * JniParser_v2_6 + *

+ * JniParser version to support Lttng traceformat of version 2.6
+ * This class extend abstract class JniParser with (possibly) version specific implementation.
+ *

+ */ +public class JniParser_v2_6 extends JniParser { + + /* + * Forbid access to the default constructor + */ + protected JniParser_v2_6() { + super(); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniTrace_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniTrace_v2_6.java new file mode 100644 index 0000000000..9edc5498c3 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniTrace_v2_6.java @@ -0,0 +1,86 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_6; +/******************************************************************************* + * Copyright (c) 2009, 2011 Ericsson, MontaVista Software + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path + * Yufen Kuo (ykuo@mvista.com) - bug 340341: handle gracefully when native library failed to initialize + *******************************************************************************/ + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniTrace; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniTrace_v2_6 + *

+ * JniTrace version to support Lttng traceformat of version 2.6.
+ * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).
+ * + * It also make sure the correct library is loaded by liblttvlibraryloader.so + *

+ */ +public class JniTrace_v2_6 extends JniTrace { + + // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load. + // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path. + // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. + private static final String LIBRARY_NAME = "liblttvtraceread-2.6.so"; //$NON-NLS-1$ + + /* + * Forbid access to the default constructor + */ + protected JniTrace_v2_6() { + super(); + } + + public JniTrace_v2_6(String newpath) throws JniException { + super(newpath); + } + + public JniTrace_v2_6(String newpath, boolean newPrintDebug) throws JniException { + super(newpath, newPrintDebug); + } + + public JniTrace_v2_6(JniTrace_v2_6 oldTrace) { + super(oldTrace); + } + + public JniTrace_v2_6(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { + super(newPtr, newPrintDebug); + } + + /** + * Get the trace library name + *

+ * + * Get the version specific native trace library name + * + * @return The native trace library name + */ + @Override + public String getTraceLibName() { + return LIBRARY_NAME; + } + + /** + * Allocate (call constructor for) a new JniTracefile.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTrace + * + * @return JniTracefile a newly allocated JniTracefile + * + * @see org.eclipse.linuxtools.lttng.jni.JniTrace + */ + @Override + public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + return new JniTracefile_v2_6(newPtr, newParentTrace); + } +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniTracefile_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniTracefile_v2_6.java new file mode 100644 index 0000000000..6090235b99 --- /dev/null +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/internal/lttng/jni_v2_6/JniTracefile_v2_6.java @@ -0,0 +1,78 @@ +package org.eclipse.linuxtools.internal.lttng.jni_v2_6; +/******************************************************************************* + * Copyright (c) 2009 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * William Bourque (wbourque@gmail.com) - Initial API and implementation + *******************************************************************************/ + +import java.util.HashMap; + +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.lttng.jni.JniEvent; +import org.eclipse.linuxtools.lttng.jni.JniMarker; +import org.eclipse.linuxtools.lttng.jni.JniTrace; +import org.eclipse.linuxtools.lttng.jni.JniTracefile; + +/** + * JniTracefile_v2_6 + *

+ * JniTracefile version to support Lttng traceformat of version 2.6
+ * This class extend abstract class JniTracefile with (possibly) version specific implementation.
+ *

+ */ +public class JniTracefile_v2_6 extends JniTracefile { + + /* + * Forbid access to the default constructor + */ + protected JniTracefile_v2_6() { + super(); + } + + + public JniTracefile_v2_6(JniTracefile_v2_6 oldTracefile) { + super(oldTracefile); + } + + public JniTracefile_v2_6(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { + super(newPtr, newParentTrace); + } + + + /** + * Allocate (call constructor for) a new JniEvent.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTracefile + * + * @return JniEvent a newly allocated JniEvent + * + * @see org.eclipse.linuxtools.lttng.jni.JniTracefile + */ + @Override + public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { + return new JniEvent_v2_6(newEventPtr, newMarkersMap, newParentTracefile); + } + + + /** + * Allocate (call constructor for) a new JniMarker.

+ * + * This method is made to bypass limitation related to abstract class, see comment in JniTracefile + * + * @return JniMarker a newly allocated JniMarker + * + * @see org.eclipse.linuxtools.lttng.jni.JniTracefile + */ + @Override + public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { + return new JniMarker_v2_6(newMarkerPtr); + } + +} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java index 463bd11c07..247bf11880 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniEvent.java @@ -14,11 +14,11 @@ package org.eclipse.linuxtools.lttng.jni; import java.util.HashMap; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniEventException; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; -import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniEventException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniNoSuchEventException; /** * JniEvent

@@ -120,7 +120,7 @@ public abstract class JniEvent extends Jni_C_Common implements ComparableJniMarker

@@ -168,7 +168,7 @@ public abstract class JniMarker extends Jni_C_Common * * @return The actual (long converted) pointer or NULL * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public Jni_C_Pointer_And_Library_Id getMarkerPtr() { return thisMarkerPtr; @@ -241,7 +241,7 @@ public abstract class JniMarker extends Jni_C_Common * * @throws JniException The construction (allocation) failed. * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id * @see org.eclipse.linuxtools.lttng.jni.JniMarkerField */ public abstract JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException; diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java index 4840062bce..0e4f1b83c3 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniMarkerField.java @@ -1,8 +1,8 @@ package org.eclipse.linuxtools.lttng.jni; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; -import org.eclipse.linuxtools.lttng.jni.exception.JniMarkerFieldException; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniMarkerFieldException; /** @@ -66,7 +66,7 @@ public abstract class JniMarkerField extends Jni_C_Common * * @exception JniException * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public JniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { thisMarkerFieldPtr = newMarkerFieldPtr; @@ -105,7 +105,7 @@ public abstract class JniMarkerField extends Jni_C_Common * * @return The actual (long converted) pointer or NULL * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public Jni_C_Pointer_And_Library_Id getMarkerFieldPtr() { return thisMarkerFieldPtr; diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java index adeafd9ff5..b070b14ae5 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniParser.java @@ -15,7 +15,7 @@ package org.eclipse.linuxtools.lttng.jni; import java.util.HashMap; import java.util.Iterator; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer; /** * JniParser

diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java index febb99e485..bf335e5e28 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTrace.java @@ -20,12 +20,12 @@ import java.util.PriorityQueue; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; -import org.eclipse.linuxtools.lttng.jni.exception.JniOpenTraceFailedException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTraceException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventException; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniOpenTraceFailedException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTraceException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTracefileWithoutEventException; /** * JniTrace @@ -229,7 +229,7 @@ public abstract class JniTrace extends Jni_C_Common { * * @exception JniException * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public JniTrace(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { thisTracePtr = newPtr; @@ -612,7 +612,7 @@ public abstract class JniTrace extends Jni_C_Common { * * @param seekTime The time where we want to seek to * - * @see org.eclipse.linuxtools.lttng.jni.common.JniTime + * @see org.eclipse.linuxtools.internal.lttng.jni.common.JniTime */ public void seekToTime(JniTime seekTime) { @@ -643,7 +643,7 @@ public abstract class JniTrace extends Jni_C_Common { * @param seekTime The time where we want to seek to * * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - * @see org.eclipse.linuxtools.lttng.jni.common.JniTime + * @see org.eclipse.linuxtools.internal.lttng.jni.common.JniTime */ public void seekToTime(JniTime seekTime, JniTracefile targetTracefile) { // Invalidate the current read event @@ -674,7 +674,7 @@ public abstract class JniTrace extends Jni_C_Common { * @return The event just after the seeked time or null if none available. * * @see org.eclipse.linuxtools.lttng.jni.JniEvent - * @see org.eclipse.linuxtools.lttng.jni.common.JniTime + * @see org.eclipse.linuxtools.internal.lttng.jni.common.JniTime */ public JniEvent seekAndRead(JniTime seekTime) { JniEvent returnedEvent = null; @@ -703,7 +703,7 @@ public abstract class JniTrace extends Jni_C_Common { * @return The event just after the seeked time or null if none available. * * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - * @see org.eclipse.linuxtools.lttng.jni.common.JniTime + * @see org.eclipse.linuxtools.internal.lttng.jni.common.JniTime * @see org.eclipse.linuxtools.lttng.jni.JniEvent */ public JniEvent seekAndRead(JniTime seekTime, JniTracefile targetTracefile) { @@ -837,7 +837,7 @@ public abstract class JniTrace extends Jni_C_Common { * * @return Time of the last event read * - * @see org.eclipse.linuxtools.lttng.jni.common.JniTime + * @see org.eclipse.linuxtools.internal.lttng.jni.common.JniTime */ public JniTime getCurrentEventTimestamp() { JniTime returnedTime = null; @@ -861,7 +861,7 @@ public abstract class JniTrace extends Jni_C_Common { * * @return The actual (long converted) pointer or NULL. * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public Jni_C_Pointer_And_Library_Id getTracePtr() { return thisTracePtr; @@ -992,7 +992,7 @@ public abstract class JniTrace extends Jni_C_Common { * @throws JniException The construction (allocation) failed. * * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id * @see org.eclipse.linuxtools.lttng.jni.JniTrace */ public abstract JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException; diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java index 383b4e38e5..e1545c747f 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/JniTracefile.java @@ -14,13 +14,13 @@ package org.eclipse.linuxtools.lttng.jni; import java.util.HashMap; -import org.eclipse.linuxtools.lttng.jni.common.JniTime; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; -import org.eclipse.linuxtools.lttng.jni.exception.JniNoSuchEventException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTracefileWithoutEventException; +import org.eclipse.linuxtools.internal.lttng.jni.common.JniTime; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniNoSuchEventException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTracefileException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTracefileWithoutEventException; /** * JniTracefile @@ -172,7 +172,7 @@ public abstract class JniTracefile extends Jni_C_Common * @exception JniException * * @see org.eclipse.linuxtools.lttng.jni.JniTrace - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public JniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { thisTracefilePtr = newPtr; @@ -195,7 +195,7 @@ public abstract class JniTracefile extends Jni_C_Common * * @return LTT read status, as defined in Jni_C_Constant * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Constant */ public int readNextEvent() { return currentEvent.readNextEvent(); @@ -210,7 +210,7 @@ public abstract class JniTracefile extends Jni_C_Common * * @return LTT read status, as defined in Jni_C_Constant * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Constant */ public int seekToTime(JniTime seekTime) { return currentEvent.seekToTime(seekTime); @@ -404,7 +404,7 @@ public abstract class JniTracefile extends Jni_C_Common * * @return The actual (long converted) pointer or NULL. * - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public Jni_C_Pointer_And_Library_Id getTracefilePtr() { return thisTracefilePtr; @@ -485,7 +485,7 @@ public abstract class JniTracefile extends Jni_C_Common * @throws JniException The construction (allocation) failed. * * @see org.eclipse.linuxtools.lttng.jni.JniEvent - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id * @see org.eclipse.linuxtools.lttng.jni.JniMarker * @see org.eclipse.linuxtools.lttng.jni.JniTracefile */ @@ -507,7 +507,7 @@ public abstract class JniTracefile extends Jni_C_Common * @throws JniException The construction (allocation) failed. * * @see org.eclipse.linuxtools.lttng.jni.JniMarker - * @see org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id + * @see org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Pointer_And_Library_Id */ public abstract JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException; diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java index d9895e4cf0..901293da86 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/Jni_C_Common.java @@ -1,6 +1,6 @@ package org.eclipse.linuxtools.lttng.jni; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Constant; +import org.eclipse.linuxtools.internal.lttng.jni.common.Jni_C_Constant; /******************************************************************************* * Copyright (c) 2009 Ericsson diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/JniTime.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/JniTime.java deleted file mode 100644 index 5279940d3c..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/JniTime.java +++ /dev/null @@ -1,213 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.common; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniTime - *

- * Used to store (event, trace, tracefile, ...) timestamp. - * - * Mimic the behavior of the LttTime C structure. - */ -public class JniTime extends Jni_C_Constant implements Comparable -{ - private long time = 0; - - /** - * Default constructor.

- * - * Note : Time will be set to 0. - * - */ - public JniTime() { - time = 0; - } - - /** - * Copy constructor. - * - * @param oldTime Reference to the JniTime you want to copy. - */ - public JniTime(JniTime oldTime) { - time = oldTime.getTime(); - } - - /** - * Constructor with parameters.

- * - * "LTT style" constructor with Seconds et Nanoseconds - * - * @param newSec Seconds of the JniTime - * @param newNanoSec Nanoseconds of the JniTime - */ - public JniTime(long newSec, long newNanoSec) { - time = (newSec * NANO) + newNanoSec; - } - - /** - * Constructor with parameters.

- * - * Usual "nanosecond only" constructor. - * - * @param newNanoSecTime Time in nanoseconds - */ - public JniTime(long newNanoSecTime) { - time = newNanoSecTime; - } - - /** - * Second of the time.

- * - * Returns seconds, i.e. multiple of 1 000 000, of the stored nanoseconds time. - * - * @return Second of this time. - */ - public long getSeconds() { - return (time / NANO); - } - - /** - * Getter for the nanosecond of the time.

- * - * Returns nanoseconds part, i.e. modulo of 1 000 000, of the stored nanoseconds time. - * - * @return Nanoseconds of this time - */ - public long getNanoSeconds() { - return time % NANO; - } - - /** - * Full time, in nanoseconds.

- * - * @return Complete time in nanoseconds - */ - public long getTime() { - return time; - } - - /** - * Changes the current time for this object

- * - * @param newTime New time to set, in nanoseconds. - */ - public void setTime(long newTime) { - time = newTime; - } - - /* - * Populate this time object - * - * Note: This function is called from C side. - * - * @param newTime The time we want to populate - */ - @SuppressWarnings("unused") - private void setTimeFromC(long newTime) { - time = newTime; - } - - /** - * Comparaison operator smaller or equal than "<=" .

- * - * @param comparedTime The time we want to compare with this one - * - * @return true if compared time is smaller or equal, false otherwise - */ - public boolean isSmallerOrEqual(JniTime comparedTime) { - - // NOTE : We check <= instead of just < - // This mean the LEFT OPERAND (comparedTime) always prevails - if (this.getTime() <= comparedTime.getTime() ) { - return true; - } - else { - return false; - } - } - - /** - * compareTo operator.

- * - * @param right The time we want to compare with this one - * - * @return int of value -1, 0 or 1, as the pased argument is bigger, equal or smaller than this time - */ - @Override - public int compareTo(JniTime right) { - long leftTime = this.getTime(); - long rightTime = right.getTime(); - - if ( leftTime < rightTime ) { - return -1; - } - else if ( leftTime > rightTime ) { - return 1; - } - else { - return 0; - } - } - - /** - * faster equals since it is called very often - * @param other the object to the right of this - * @return true if the times are the same, false otherwise. - */ - public boolean equals(JniTime other) { - return ((other != null) && (this.time == other.time)); - } - - /** - * Overridden equals for JniTime type - * - * @param The object we want to compare too - * - * @return true if the time is the same, false otherwise. - */ - @Override - public boolean equals(Object obj) { - if (obj instanceof JniTime) { - return (((JniTime) obj).time == this.time); - } - return false; - } - - /** - * Overridden hash code for JniTime type - * - */ - @Override - public int hashCode() { - return this.toString().hashCode(); - } - - - /** - * toString() method. - * Intended to debug

- * - * NOTE : We output the time in the same format as LTT (seconds and nanosecond separatly) - * - * @return String Attributes of the object concatenated in String - */ - @Override - @SuppressWarnings("nls") - public String toString() { - String returnData = ""; - - returnData += "seconds : " + this.getSeconds() + "\n"; - returnData += "nanoSeconds : " + this.getNanoSeconds() + "\n"; - - return returnData; - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Constant.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Constant.java deleted file mode 100644 index dd3609c758..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Constant.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.common; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * Jni_C_Common - *

- * Common constants and methods that should be shared between JNI objects.

- * - * This class is abstract and is intended to be extended by LTTng modules that need the constants. - */ -public abstract class Jni_C_Constant { - - // Needed for native types - public static final int NULL = 0; - - // C errno correspondance. Used to interpret LTT return value - public static final int EOK = 0; - public static final int EPERM = 1; - public static final int ERANGE = 34; - - // Timestamps are in nanoseconds, this const ease up the math - public static final long NANO = 1000000000; - - /** - * Default constructor - */ - public Jni_C_Constant() { - } - - /** - * "Alternate" .toString()

- * - * Simulates the way Java Object implements "toString()" - * - * @return The Java hashed UID of the object (i.e. : NAME@HASH) - */ - @SuppressWarnings("nls") - public String getReferenceToString() { - return this.getClass().getName() + "@" + Integer.toHexString(this.hashCode()); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java deleted file mode 100644 index b04be0f4b1..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer.java +++ /dev/null @@ -1,105 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.common; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * Jni_C_Pointer - *

- * Class pointer to handle properly "C pointer"

- * - * Can transparently handle pointer of 32 or 64 bits. - */ -public class Jni_C_Pointer extends Jni_C_Constant { - - protected long ptr = NULL; - protected boolean isLong = true; - - /** - * Default constructor.

- * - * Note : Pointer will be set to a 64bits "NULL". - */ - public Jni_C_Pointer() { - ptr = NULL; - } - - /** - * Constructor with parameters for 64bits pointers. - * - * @param newPtr long-converted (64 bits) C pointer. - */ - public Jni_C_Pointer(long newPtr) { - ptr = newPtr; - isLong = true; - } - - /** - * Constructor with parameters for 32bits pointers. - * - * @param newPtr int-converted (32 bits) C pointer. - */ - public Jni_C_Pointer(int newPtr) { - ptr = (long)newPtr; - isLong = false; - } - - /** - * Get the current pointer. - * - * @return The current pointer, in long. - */ - public long getPointer() { - return ptr; - } - - /** - * Set the pointer, as a 64bits pointer. - * - * @param newPtr long-converted (64 bits) C pointer. - */ - public void setPointer(long newPtr) { - ptr = newPtr; - isLong = true; - } - - /** - * Set the pointer, as a 64bits pointer. - * - * @param newPtr int-converted (32 bits) C pointer. - */ - public void setPointer(int newPtr) { - ptr = newPtr; - isLong = false; - } - - /** - * toString() method.

- * - * Convert the pointer to a nice looking int/long hexadecimal format. - * - * @return Attributes of the object concatenated in String - */ - @Override - @SuppressWarnings("nls") - public String toString() { - String returnData = "0x"; - - if (isLong == true) { - returnData += Long.toHexString(ptr); - } - else { - returnData += Integer.toHexString((int) ptr); - } - - return returnData; - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer_And_Library_Id.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer_And_Library_Id.java deleted file mode 100644 index 6e7f1d48ec..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/common/Jni_C_Pointer_And_Library_Id.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.common; - -public class Jni_C_Pointer_And_Library_Id extends Jni_C_Pointer { - - // *** Library Id - // Needed to know which library we need to make our functions call in case several are loaded - // This make possible to use several different trace version at the same time - private int libraryId = -1; - - /** - * Default constructor.

- * - * Note : Pointer will be set to a 64bits "NULL" and Id -1. - */ - public Jni_C_Pointer_And_Library_Id() { - super(); - libraryId = -1; - } - - /** - * Constructor with parameters for 64bits pointers and library handle id. - * - * @param newPtr long-converted (64 bits) C pointer. - * @param newHandle a valid library id as int - */ - public Jni_C_Pointer_And_Library_Id(int newId, long newPtr) { - super(newPtr); - libraryId = newId; - } - - /** - * Constructor with parameters for 32bits pointers and library handle id. - * - * @param newPtr int-converted (32 bits) C pointer. - * @param newHandle a valid library id as int - */ - public Jni_C_Pointer_And_Library_Id(int newId, int newPtr) { - super(newPtr); - libraryId = newId; - } - - /** - * Copy constructor.

- * - * @param oldPointerAndId The old object to copy from. - */ - public Jni_C_Pointer_And_Library_Id(Jni_C_Pointer_And_Library_Id oldPointerAndId) { - super(oldPointerAndId.ptr); - libraryId = oldPointerAndId.libraryId; - } - - /** - * Get the library handle id currently in use.

- * Id is used to tell the C which version of the functions to call.

- * - * @return The current id - */ - public int getLibraryId() { - return libraryId; - } - - /** - * Set a new library id.

- * Id is used to tell the C which version of the functions to call.

- * - * @param newHandleId The new Id to use (must be a valid id for the C library). - */ - public void setLibraryId(int newId) { - this.libraryId = newId; - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventException.java deleted file mode 100644 index f87ef318a1..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventException.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniEventException - *

- * Basic exception class for the JniEvent class - */ -public class JniEventException extends JniException { - private static final long serialVersionUID = -5891749130387304519L; - - public JniEventException(String errMsg) { - super(errMsg); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventOutOfRangeException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventOutOfRangeException.java deleted file mode 100644 index ccd8b996fc..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniEventOutOfRangeException.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniEventOutOfRangeException - *

- * Sub-exception type for the JniEventException type - * This exception type will get thrown when there is no more event of this type - * available - */ -public class JniEventOutOfRangeException extends JniEventException { - private static final long serialVersionUID = -4645877232795324541L; - - public JniEventOutOfRangeException(String errMsg) { - super(errMsg); - } -} - diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniException.java deleted file mode 100644 index 1ba46b7d42..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - - -/** - * JniException - *

- * Super class for JNI exception. - */ -public class JniException extends Exception { - private static final long serialVersionUID = -6620784221853154537L; - - public JniException(String errMsg) { - super(errMsg); - } -} - diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerException.java deleted file mode 100644 index b6f009b926..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerException.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniMarkerException - *

- * Basic Exception class for the JniMarker class - */ -public class JniMarkerException extends JniException { - private static final long serialVersionUID = -4694173610721983794L; - - public JniMarkerException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerFieldException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerFieldException.java deleted file mode 100644 index 123e4714c2..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniMarkerFieldException.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniMarkerFieldException - *

- * Basic Exception class for the JniMarkerField class - */ -public class JniMarkerFieldException extends JniException { - private static final long serialVersionUID = 6066381741374806879L; - - public JniMarkerFieldException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoNextEventInTraceException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoNextEventInTraceException.java deleted file mode 100644 index 76aaa5e28f..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoNextEventInTraceException.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniNoNextEventInTraceException - *

- * Sub-exception class type for JniTraceException - * This type will get thrown when we can't find any "next" event - * This should usually mean there is no more event in the trace - - */ -public class JniNoNextEventInTraceException extends JniTraceException { - private static final long serialVersionUID = -2887528566100063849L; - - public JniNoNextEventInTraceException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoSuchEventException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoSuchEventException.java deleted file mode 100644 index 478d07953a..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniNoSuchEventException.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniNoSuchEventException - *

- * Sub-exception type for the JniEventException type - * This exception type will get thrown when an event is unavailable - * This might happen at construction because some events type are not present in - * the trace - */ -public class JniNoSuchEventException extends JniEventException { - private static final long serialVersionUID = -4379712949891538051L; - - public JniNoSuchEventException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniOpenTraceFailedException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniOpenTraceFailedException.java deleted file mode 100644 index 963f703b5f..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniOpenTraceFailedException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniOpenTraceFailedException - *

- * Sub-exception class type for JniTraceException - * This type will get thrown when a trace fail to open - * Most likely to be caused by a bad tracepath - */ -public class JniOpenTraceFailedException extends JniTraceException { - private static final long serialVersionUID = 877769692366394895L; - - public JniOpenTraceFailedException(String errMsg) { - super(errMsg); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceException.java deleted file mode 100644 index b89cd0c78f..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceException.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniTraceException - *

- * Basic exception class for the JniTrace class - */ -public class JniTraceException extends JniException { - private static final long serialVersionUID = -6873007333085268143L; - - public JniTraceException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceVersionException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceVersionException.java deleted file mode 100644 index 2eb3916545..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTraceVersionException.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniTraceVersionException - *

- * Basic exception class for the JniTraceVersion class - */ -public class JniTraceVersionException extends JniException { - private static final long serialVersionUID = -5891749123457304519L; - - public JniTraceVersionException(String errMsg) { - super(errMsg); - } -} \ No newline at end of file diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileException.java deleted file mode 100644 index 54a26a73dd..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileException.java +++ /dev/null @@ -1,25 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniTracefileException - *

- * Basic exception class for the JniTracefile class - */ -public class JniTracefileException extends JniException { - private static final long serialVersionUID = 5081317864491800084L; - - public JniTracefileException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileWithoutEventException.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileWithoutEventException.java deleted file mode 100644 index e8cc5227d6..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/exception/JniTracefileWithoutEventException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni.exception; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -/** - * JniTracefileWithoutEventException - *

- * Sub-exception class type for JniTracefileException - * This type will get thrown when a trace file contain no readable events - * The proper course of action would usually be to ignore this useless trace file - */ -public class JniTracefileWithoutEventException extends JniTracefileException { - private static final long serialVersionUID = -8183967479236071261L; - - public JniTracefileWithoutEventException(String errMsg) { - super(errMsg); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceFactory.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceFactory.java index ce29a75b6b..6bbe622b64 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceFactory.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceFactory.java @@ -12,12 +12,12 @@ package org.eclipse.linuxtools.lttng.jni.factory; * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path *******************************************************************************/ +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTraceVersionException; +import org.eclipse.linuxtools.internal.lttng.jni_v2_3.JniTrace_v2_3; +import org.eclipse.linuxtools.internal.lttng.jni_v2_5.JniTrace_v2_5; +import org.eclipse.linuxtools.internal.lttng.jni_v2_6.JniTrace_v2_6; import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTraceVersionException; -import org.eclipse.linuxtools.lttng.jni_v2_3.JniTrace_v2_3; -import org.eclipse.linuxtools.lttng.jni_v2_5.JniTrace_v2_5; -import org.eclipse.linuxtools.lttng.jni_v2_6.JniTrace_v2_6; /** * JniTraceFactory diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceVersion.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceVersion.java index c492c18783..6b9f7bc327 100644 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceVersion.java +++ b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni/factory/JniTraceVersion.java @@ -14,8 +14,8 @@ package org.eclipse.linuxtools.lttng.jni.factory; import java.io.File; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; -import org.eclipse.linuxtools.lttng.jni.exception.JniTraceVersionException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniException; +import org.eclipse.linuxtools.internal.lttng.jni.exception.JniTraceVersionException; /** * JniTraceVersion diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java deleted file mode 100644 index c37168b400..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniEvent_v2_3.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_3; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import java.util.HashMap; - -import org.eclipse.linuxtools.lttng.jni.JniEvent; -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniEvent_v2_3 - *

- * JniEvent version to support Lttng traceformat of version 2.3
- * This class extend abstract class JniEvent with (possibly) version specific implementation.
- *

- */ -public class JniEvent_v2_3 extends JniEvent { - - /* - * Forbid access to the default constructor - */ - protected JniEvent_v2_3() { - super(); - } - - public JniEvent_v2_3(JniEvent_v2_3 oldEvent) { - super(oldEvent); - } - - public JniEvent_v2_3(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { - super(newEventPtr, newMarkersMap, newParentTracefile); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java deleted file mode 100644 index c67e0a7de1..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarkerField_v2_3.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_3; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniMarkerField_v2_3 - *

- * JniMarkerField version to support Lttng traceformat of version 2.3
- * This class extend abstract class JniMarkerField with (possibly) version specific implementation.
- *

- */ -public class JniMarkerField_v2_3 extends JniMarkerField { - - /* - * Forbid access to the default constructor - */ - protected JniMarkerField_v2_3() { - super(); - } - - - public JniMarkerField_v2_3(JniMarkerField_v2_3 oldMarkerField) { - super(oldMarkerField); - } - - public JniMarkerField_v2_3(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { - super(newMarkerFieldPtr); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java deleted file mode 100644 index 58ca0655a2..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniMarker_v2_3.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_3; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniMarker_v2_3 - *

- * JniMarker version to support Lttng traceformat of version 2.3
- * This class extend abstract class JniMarker with (possibly) version specific implementation.
- *

- */ -public class JniMarker_v2_3 extends JniMarker { - - /* - * Forbid access to the default constructor - */ - protected JniMarker_v2_3() { - super(); - } - - - public JniMarker_v2_3(JniMarker_v2_3 oldMarker) { - super(oldMarker); - } - - public JniMarker_v2_3(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { - super(newMarkerPtr); - } - - - /** - * Allocate (call constructor for) a new JniMarkerField.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniMarker - * - * @return JniMarkerField a newly allocated JniMarkerField - * - * @see org.eclipse.linuxtools.lttng.jni.JniMarker - */ - @Override - public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { - return new JniMarkerField_v2_3(newMarkerFieldPtr); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser_v2_3.java deleted file mode 100644 index d00636e4be..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniParser_v2_3.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_3; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniParser; - -/** - * JniParser_v2_3 - *

- * JniParser version to support Lttng traceformat of version 2.3
- * This class extend abstract class JniParser with (possibly) version specific implementation.
- *

- */ -public class JniParser_v2_3 extends JniParser { - - /* - * Forbid access to the default constructor - */ - protected JniParser_v2_3() { - super(); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java deleted file mode 100644 index f99efa009c..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTrace_v2_3.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_3; -/******************************************************************************* - * Copyright (c) 2009, 2011 Ericsson, MontaVista Software - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path - * Yufen Kuo (ykuo@mvista.com) - bug 340341: handle gracefully when native library failed to initialize - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniTrace_v2_3 - *

- * JniTrace version to support Lttng traceformat of version 2.3.
- * This class extend abstract class JniTrace with (possibly) version specific implementation.
- * - * It also make sure the correct library is loaded by liblttvlibraryloader.so - *

- */ -public class JniTrace_v2_3 extends JniTrace { - - // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load. - // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path. - // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. - private static final String LIBRARY_NAME = "liblttvtraceread-2.3.so"; //$NON-NLS-1$ - - /* - * Forbid access to the default constructor - */ - protected JniTrace_v2_3() { - super(); - } - - - public JniTrace_v2_3(String newpath) throws JniException { - super(newpath); - } - - public JniTrace_v2_3(String newpath, boolean newPrintDebug) throws JniException { - super(newpath, newPrintDebug); - } - - - public JniTrace_v2_3(JniTrace_v2_3 oldTrace) { - super(oldTrace); - } - - public JniTrace_v2_3(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { - super(newPtr, newPrintDebug); - } - - /** - * Get the trace library name - *

- * - * Get the version specific native trace library name - * - * @return The native trace library name - */ - @Override - public String getTraceLibName() { - return LIBRARY_NAME; - } - - /** - * Allocate (call constructor for) a new JniTracefile.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTrace - * - * @return JniTracefile a newly allocated JniTracefile - * - * @see org.eclipse.linuxtools.lttng.jni.JniTrace - */ - @Override - public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { - return new JniTracefile_v2_3(newPtr, newParentTrace); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java deleted file mode 100644 index 44254572b4..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_3/JniTracefile_v2_3.java +++ /dev/null @@ -1,77 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_3; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import java.util.HashMap; - -import org.eclipse.linuxtools.lttng.jni.JniEvent; -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniTracefile_v2_3 - *

- * JniTracefile version to support Lttng traceformat of version 2.3
- * This class extend abstract class JniTracefile with (possibly) version specific implementation.
- *

- */ -public class JniTracefile_v2_3 extends JniTracefile { - - /* - * Forbid access to the default constructor - */ - protected JniTracefile_v2_3() { - super(); - } - - - public JniTracefile_v2_3(JniTracefile_v2_3 oldTracefile) { - super(oldTracefile); - } - - public JniTracefile_v2_3(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { - super(newPtr, newParentTrace); - } - - - /** - * Allocate (call constructor for) a new JniEvent.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTracefile - * - * @return JniEvent a newly allocated JniEvent - * - * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - */ - @Override - public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { - return new JniEvent_v2_3(newEventPtr, newMarkersMap, newParentTracefile); - } - - - /** - * Allocate (call constructor for) a new JniMarker.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTracefile - * - * @return JniMarker a newly allocated JniMarker - * - * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - */ - @Override - public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { - return new JniMarker_v2_3(newMarkerPtr); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java deleted file mode 100644 index 6e3898af33..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniEvent_v2_5.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_5; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import java.util.HashMap; - -import org.eclipse.linuxtools.lttng.jni.JniEvent; -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniEvent_v2_5 - *

- * JniEvent version to support Lttng traceformat of version 2.5
- * This class extend abstract class JniEvent with (possibly) version specific implementation.
- *

- */ -public class JniEvent_v2_5 extends JniEvent { - - /* - * Forbid access to the default constructor - */ - protected JniEvent_v2_5() { - super(); - } - - public JniEvent_v2_5(JniEvent_v2_5 oldEvent) { - super(oldEvent); - } - - public JniEvent_v2_5(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { - super(newEventPtr, newMarkersMap, newParentTracefile); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java deleted file mode 100644 index 8900dff6e4..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarkerField_v2_5.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_5; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniMarkerField_v2_5 - *

- * JniMarkerField version to support Lttng traceformat of version 2.5
- * This class extend abstract class JniMarkerField with (possibly) version specific implementation.
- *

- */ -public class JniMarkerField_v2_5 extends JniMarkerField { - - /* - * Forbid access to the default constructor - */ - protected JniMarkerField_v2_5() { - super(); - } - - - public JniMarkerField_v2_5(JniMarkerField_v2_5 oldMarkerField) { - super(oldMarkerField); - } - - public JniMarkerField_v2_5(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { - super(newMarkerFieldPtr); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java deleted file mode 100644 index d7dafc09a8..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniMarker_v2_5.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_5; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniMarker_v2_5 - *

- * JniMarker version to support Lttng traceformat of version 2.5
- * This class extend abstract class JniMarker with (possibly) version specific implementation.
- *

- */ -public class JniMarker_v2_5 extends JniMarker { - - /* - * Forbid access to the default constructor - */ - protected JniMarker_v2_5() { - super(); - } - - - public JniMarker_v2_5(JniMarker_v2_5 oldMarker) { - super(oldMarker); - } - - public JniMarker_v2_5(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { - super(newMarkerPtr); - } - - - /** - * Allocate (call constructor for) a new JniMarkerField.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniMarker - * - * @return JniMarkerField a newly allocated JniMarkerField - * - * @see org.eclipse.linuxtools.lttng.jni.JniMarker - */ - @Override - public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { - return new JniMarkerField_v2_5(newMarkerFieldPtr); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser_v2_5.java deleted file mode 100644 index 81a62cbb77..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniParser_v2_5.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_5; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniParser; - -/** - * JniParser_v2_5 - *

- * JniParser version to support Lttng traceformat of version 2.5
- * This class extend abstract class JniParser with (possibly) version specific implementation.
- *

- */ -public class JniParser_v2_5 extends JniParser { - - /* - * Forbid access to the default constructor - */ - protected JniParser_v2_5() { - super(); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java deleted file mode 100644 index 0fd10b14be..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTrace_v2_5.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_5; -/******************************************************************************* - * Copyright (c) 2009, 2011 Ericsson, MontaVista Software - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path - * Yufen Kuo (ykuo@mvista.com) - bug 340341: handle gracefully when native library failed to initialize - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniTrace_v2_5 - *

- * JniTrace version to support Lttng traceformat of version 2.5.
- * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).
- * - * It also make sure the correct library is loaded by liblttvlibraryloader.so - *

- */ -public class JniTrace_v2_5 extends JniTrace { - - // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load. - // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path. - // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. - private static final String LIBRARY_NAME = "liblttvtraceread-2.5.so"; //$NON-NLS-1$ - - /* - * Forbid access to the default constructor - */ - protected JniTrace_v2_5() { - super(); - } - - - public JniTrace_v2_5(String newpath) throws JniException { - super(newpath); - } - - public JniTrace_v2_5(String newpath, boolean newPrintDebug) throws JniException { - super(newpath, newPrintDebug); - } - - - public JniTrace_v2_5(JniTrace_v2_5 oldTrace) { - super(oldTrace); - } - - public JniTrace_v2_5(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { - super(newPtr, newPrintDebug); - } - - - /** - * Get the trace library name - *

- * - * Get the version specific native trace library name - * - * @return The native trace library name - */ - @Override - public String getTraceLibName() { - return LIBRARY_NAME; - } - - /** - * Allocate (call constructor for) a new JniTracefile.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTrace - * - * @return JniTracefile a newly allocated JniTracefile - * - * @see org.eclipse.linuxtools.lttng.jni.JniTrace - */ - @Override - public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { - return new JniTracefile_v2_5(newPtr, newParentTrace); - } - - - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java deleted file mode 100644 index 6d63a22edd..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_5/JniTracefile_v2_5.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_5; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import java.util.HashMap; - -import org.eclipse.linuxtools.lttng.jni.JniEvent; -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniTracefile_v2_5 - *

- * JniTracefile version to support Lttng traceformat of version 2.5
- * This class extend abstract class JniTracefile with (possibly) version specific implementation.
- *

- */ -public class JniTracefile_v2_5 extends JniTracefile { - - /* - * Forbid access to the default constructor - */ - protected JniTracefile_v2_5() { - super(); - } - - - public JniTracefile_v2_5(JniTracefile_v2_5 oldTracefile) { - super(oldTracefile); - } - - public JniTracefile_v2_5(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { - super(newPtr, newParentTrace); - } - - - /** - * Allocate (call constructor for) a new JniEvent.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTracefile - * - * @return JniEvent a newly allocated JniEvent - * - * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - */ - @Override - public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { - return new JniEvent_v2_5(newEventPtr, newMarkersMap, newParentTracefile); - } - - - /** - * Allocate (call constructor for) a new JniMarker.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTracefile - * - * @return JniMarker a newly allocated JniMarker - * - * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - */ - @Override - public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { - return new JniMarker_v2_5(newMarkerPtr); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java deleted file mode 100644 index fac4f8d8a7..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniEvent_v2_6.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_6; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import java.util.HashMap; - -import org.eclipse.linuxtools.lttng.jni.JniEvent; -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniEvent_v2_6 - *

- * JniEvent version to support Lttng traceformat of version 2.6
- * This class extend abstract class JniEvent with (possibly) version specific implementation.
- *

- */ -public class JniEvent_v2_6 extends JniEvent { - - /* - * Forbid access to the default constructor - */ - protected JniEvent_v2_6() { - super(); - } - - public JniEvent_v2_6(JniEvent_v2_6 oldEvent) { - super(oldEvent); - } - - public JniEvent_v2_6(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { - super(newEventPtr, newMarkersMap, newParentTracefile); - } - -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java deleted file mode 100644 index cdff84ac60..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarkerField_v2_6.java +++ /dev/null @@ -1,42 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_6; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniMarkerField_v2_6 - *

- * JniMarkerField version to support Lttng traceformat of version 2.6
- * This class extend abstract class JniMarkerField with (possibly) version specific implementation.
- *

- */ -public class JniMarkerField_v2_6 extends JniMarkerField { - - /* - * Forbid access to the default constructor - */ - protected JniMarkerField_v2_6() { - super(); - } - - - public JniMarkerField_v2_6(JniMarkerField_v2_6 oldMarkerField) { - super(oldMarkerField); - } - - public JniMarkerField_v2_6(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { - super(newMarkerFieldPtr); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java deleted file mode 100644 index 34ecf1f5f2..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniMarker_v2_6.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_6; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniMarkerField; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniMarker_v2_6 - *

- * JniMarker version to support Lttng traceformat of version 2.6
- * This class extend abstract class JniMarker with (possibly) version specific implementation.
- *

- */ -public class JniMarker_v2_6 extends JniMarker { - - /* - * Forbid access to the default constructor - */ - protected JniMarker_v2_6() { - super(); - } - - - public JniMarker_v2_6(JniMarker_v2_6 oldMarker) { - super(oldMarker); - } - - public JniMarker_v2_6(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { - super(newMarkerPtr); - } - - - /** - * Allocate (call constructor for) a new JniMarkerField.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniMarker - * - * @return JniMarkerField a newly allocated JniMarkerField - * - * @see org.eclipse.linuxtools.lttng.jni.JniMarker - */ - @Override - public JniMarkerField allocateNewJniMarkerField(Jni_C_Pointer_And_Library_Id newMarkerFieldPtr) throws JniException { - return new JniMarkerField_v2_6(newMarkerFieldPtr); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniParser_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniParser_v2_6.java deleted file mode 100644 index 4d3bc77e92..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniParser_v2_6.java +++ /dev/null @@ -1,31 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_6; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniParser; - -/** - * JniParser_v2_6 - *

- * JniParser version to support Lttng traceformat of version 2.6
- * This class extend abstract class JniParser with (possibly) version specific implementation.
- *

- */ -public class JniParser_v2_6 extends JniParser { - - /* - * Forbid access to the default constructor - */ - protected JniParser_v2_6() { - super(); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java deleted file mode 100644 index caa39829d4..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTrace_v2_6.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_6; -/******************************************************************************* - * Copyright (c) 2009, 2011 Ericsson, MontaVista Software - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - * Yufen Kuo (ykuo@mvista.com) - add support to allow user specify trace library path - * Yufen Kuo (ykuo@mvista.com) - bug 340341: handle gracefully when native library failed to initialize - *******************************************************************************/ - -import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniTrace_v2_6 - *

- * JniTrace version to support Lttng traceformat of version 2.6.
- * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).
- * - * It also make sure the correct library is loaded by liblttvlibraryloader.so - *

- */ -public class JniTrace_v2_6 extends JniTrace { - - // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load. - // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path. - // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly. - private static final String LIBRARY_NAME = "liblttvtraceread-2.6.so"; //$NON-NLS-1$ - - /* - * Forbid access to the default constructor - */ - protected JniTrace_v2_6() { - super(); - } - - public JniTrace_v2_6(String newpath) throws JniException { - super(newpath); - } - - public JniTrace_v2_6(String newpath, boolean newPrintDebug) throws JniException { - super(newpath, newPrintDebug); - } - - public JniTrace_v2_6(JniTrace_v2_6 oldTrace) { - super(oldTrace); - } - - public JniTrace_v2_6(Jni_C_Pointer_And_Library_Id newPtr, boolean newPrintDebug) throws JniException { - super(newPtr, newPrintDebug); - } - - /** - * Get the trace library name - *

- * - * Get the version specific native trace library name - * - * @return The native trace library name - */ - @Override - public String getTraceLibName() { - return LIBRARY_NAME; - } - - /** - * Allocate (call constructor for) a new JniTracefile.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTrace - * - * @return JniTracefile a newly allocated JniTracefile - * - * @see org.eclipse.linuxtools.lttng.jni.JniTrace - */ - @Override - public JniTracefile allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { - return new JniTracefile_v2_6(newPtr, newParentTrace); - } -} diff --git a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java b/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java deleted file mode 100644 index 2aeebaa28a..0000000000 --- a/org.eclipse.linuxtools.lttng.jni/src/org/eclipse/linuxtools/lttng/jni_v2_6/JniTracefile_v2_6.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.eclipse.linuxtools.lttng.jni_v2_6; -/******************************************************************************* - * Copyright (c) 2009 Ericsson - * - * All rights reserved. This program and the accompanying materials are - * made available under the terms of the Eclipse Public License v1.0 which - * accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * William Bourque (wbourque@gmail.com) - Initial API and implementation - *******************************************************************************/ - -import java.util.HashMap; - -import org.eclipse.linuxtools.lttng.jni.JniEvent; -import org.eclipse.linuxtools.lttng.jni.JniMarker; -import org.eclipse.linuxtools.lttng.jni.JniTrace; -import org.eclipse.linuxtools.lttng.jni.JniTracefile; -import org.eclipse.linuxtools.lttng.jni.common.Jni_C_Pointer_And_Library_Id; -import org.eclipse.linuxtools.lttng.jni.exception.JniException; - -/** - * JniTracefile_v2_6 - *

- * JniTracefile version to support Lttng traceformat of version 2.6
- * This class extend abstract class JniTracefile with (possibly) version specific implementation.
- *

- */ -public class JniTracefile_v2_6 extends JniTracefile { - - /* - * Forbid access to the default constructor - */ - protected JniTracefile_v2_6() { - super(); - } - - - public JniTracefile_v2_6(JniTracefile_v2_6 oldTracefile) { - super(oldTracefile); - } - - public JniTracefile_v2_6(Jni_C_Pointer_And_Library_Id newPtr, JniTrace newParentTrace) throws JniException { - super(newPtr, newParentTrace); - } - - - /** - * Allocate (call constructor for) a new JniEvent.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTracefile - * - * @return JniEvent a newly allocated JniEvent - * - * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - */ - @Override - public JniEvent allocateNewJniEvent(Jni_C_Pointer_And_Library_Id newEventPtr, HashMap newMarkersMap, JniTracefile newParentTracefile) throws JniException { - return new JniEvent_v2_6(newEventPtr, newMarkersMap, newParentTracefile); - } - - - /** - * Allocate (call constructor for) a new JniMarker.

- * - * This method is made to bypass limitation related to abstract class, see comment in JniTracefile - * - * @return JniMarker a newly allocated JniMarker - * - * @see org.eclipse.linuxtools.lttng.jni.JniTracefile - */ - @Override - public JniMarker allocateNewJniMarker(Jni_C_Pointer_And_Library_Id newMarkerPtr) throws JniException { - return new JniMarker_v2_6(newMarkerPtr); - } - -}