javacommons/utils/javasrc/com/nokia/mj/impl/utils/DebugUtils.java
changeset 21 2a9601315dfc
child 67 63b81d807542
equal deleted inserted replaced
18:e8e63152f320 21:2a9601315dfc
       
     1 /*
       
     2 * Copyright (c) 2009 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:  ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 package com.nokia.mj.impl.utils;
       
    20 
       
    21 import com.nokia.mj.impl.rt.support.Jvm;
       
    22 import com.nokia.mj.impl.utils.Logger;
       
    23 
       
    24 public final class DebugUtils
       
    25 {
       
    26     static
       
    27     {
       
    28 
       
    29         try
       
    30         {
       
    31             Jvm.loadSystemLibrary("javautils");
       
    32         }
       
    33 
       
    34         catch (Exception e)
       
    35         {
       
    36             Logger.ELOG(Logger.EUtils, "Error loading debug utils native.",
       
    37                         e);
       
    38         }
       
    39     }
       
    40 
       
    41     /**
       
    42      * Asks Vm to do thread dump if the dumping libraries are present.
       
    43      */
       
    44     public static void doThreadDump()
       
    45     {
       
    46         _doThreadDump();
       
    47     }
       
    48 
       
    49     /**
       
    50      * Closes the thread dumper thread.
       
    51      */
       
    52     public static void closeThreadDumper()
       
    53     {
       
    54         _closeThreadDumper();
       
    55     }
       
    56 
       
    57     private static native void _doThreadDump();
       
    58     private static native void _closeThreadDumper();
       
    59 }