javacommons/jvms/j9utils/threaddump/src/j9threaddumper.h
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2009 - 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Thread dump server of J9 VM in S60,
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef J9THREADDUMPER_H
       
    20 #define J9THREADDUMPER_H
       
    21 
       
    22 #include "jni.h"
       
    23 #include "jvmri.h"
       
    24 
       
    25 #include "threaddumper.h"
       
    26 
       
    27 #include "monitor.h"
       
    28 
       
    29 class DgRasInterface;
       
    30 
       
    31 namespace java
       
    32 {
       
    33 
       
    34 namespace util
       
    35 {
       
    36 
       
    37 enum DumpTask
       
    38 {
       
    39     NO_TASK,
       
    40     DO_DUMP,
       
    41     CLOSE
       
    42 };
       
    43 
       
    44 enum DumperState
       
    45 {
       
    46     CREATED,
       
    47     ACTIVE,
       
    48     CLOSED
       
    49 };
       
    50 
       
    51 OS_NONSHARABLE_CLASS(J9ThreadDumper)
       
    52 {
       
    53 public:
       
    54     J9ThreadDumper(JavaVM* vm, DgRasInterface* jvmri);
       
    55     ~J9ThreadDumper();
       
    56 
       
    57     void doRun();
       
    58 
       
    59     void doDump();
       
    60     void close();
       
    61 
       
    62 private:
       
    63     void wakeUp();
       
    64     void moveGeneratedDumpFile();
       
    65 
       
    66 private:
       
    67     JavaVM*                            mJavaVM; //Not owned
       
    68     JNIEnv*                            mJNIEnv; //Not owned
       
    69     DgRasInterface*                    mJvmriInterface; //Not owned
       
    70     DumpTask                           mTask;
       
    71     DumperState                        mState;
       
    72     std::auto_ptr<java::util::Monitor> mMonitor;
       
    73 
       
    74 };
       
    75 
       
    76 } // namespace util
       
    77 } // namespace java
       
    78 
       
    79 
       
    80 #ifdef __SYMBIAN32__
       
    81 IMPORT_C FuncPtr JNICALL jni_lookup(const char* aName);
       
    82 #endif // __SYMBIAN32__
       
    83 
       
    84 #endif // J9THREADDUMPER_H