1 package org
.eclipse
.linuxtools
.lttng
.jni_v2_5
;
2 /*******************************************************************************
3 * Copyright (c) 2009 Ericsson
5 * All rights reserved. This program and the accompanying materials are
6 * made available under the terms of the Eclipse Public License v1.0 which
7 * accompanies this distribution, and is available at
8 * http://www.eclipse.org/legal/epl-v10.html
11 * William Bourque (wbourque@gmail.com) - Initial API and implementation
12 *******************************************************************************/
14 import org
.eclipse
.linuxtools
.lttng
.jni
.JniTrace
;
15 import org
.eclipse
.linuxtools
.lttng
.jni
.JniTracefile
;
16 import org
.eclipse
.linuxtools
.lttng
.jni
.common
.Jni_C_Pointer_And_Library_Id
;
17 import org
.eclipse
.linuxtools
.lttng
.jni
.exception
.JniException
;
20 * <b><u>JniTrace_v2_5</u></b>
22 * JniTrace version to support Lttng traceformat of version 2.5.<br>
23 * This class extend abstract class JniTrace with (possibly) version specific implementation (none yet).<br>
25 * It also make sure the correct library is loaded by liblttvlibraryloader.so
28 public class JniTrace_v2_5
extends JniTrace
{
30 // This is the dynamic library name that is passed to the library loader (liblttvlibraryloader.so) to load.
31 // It needs to be a complete name, like "libXYZ.so", unlike java that would take "XYZ". It could also take a complete path.
32 // The library need to be accessible, i.e. LD_LIBRARY_PATH need to be set correctly.
33 private static final String LIBRARY_NAME
= "liblttvtraceread-2.5.so"; //$NON-NLS-1$
36 * Forbid access to the default constructor
38 protected JniTrace_v2_5() {
43 public JniTrace_v2_5(String newpath
) throws JniException
{
47 public JniTrace_v2_5(String newpath
, boolean newPrintDebug
) throws JniException
{
48 super(newpath
, newPrintDebug
);
52 public JniTrace_v2_5(JniTrace_v2_5 oldTrace
) {
56 public JniTrace_v2_5(Jni_C_Pointer_And_Library_Id newPtr
, boolean newPrintDebug
) throws JniException
{
57 super(newPtr
, newPrintDebug
);
62 * Initialize the C library.<p>
64 * Call the library loader with the .so we wish to load.
66 * @return True if the load went successful, false otherwise.
69 public int initializeLibrary() {
70 return ltt_initializeHandle(LIBRARY_NAME
);
74 * Allocate (call constructor for) a new JniTracefile.<p>
76 * This method is made to bypass limitation related to abstract class, see comment in JniTrace
78 * @return JniTracefile a newly allocated JniTracefile
80 * @see org.eclipse.linuxtools.lttng.jni.JniTrace
83 public JniTracefile
allocateNewJniTracefile(Jni_C_Pointer_And_Library_Id newPtr
, JniTrace newParentTrace
) throws JniException
{
84 return new JniTracefile_v2_5(newPtr
, newParentTrace
);