javacommons/utils/src/startuptrace.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     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 #include "logger.h"
       
    20 #include "javaoslayer.h"
       
    21 #include "com_nokia_mj_impl_utils_StartUpTrace.h"
       
    22 #include "exceptionbase.h"
       
    23 
       
    24 JNIEXPORT void JNICALL
       
    25 Java_com_nokia_mj_impl_utils_StartUpTrace__1doTrace(
       
    26     JNIEnv* env, jclass, jstring header,
       
    27     jlong freeMem, jlong totalMem)
       
    28 {
       
    29     try
       
    30     {
       
    31         jboolean iscopy;
       
    32         const char* utf8(env->GetStringUTFChars(header, &iscopy));
       
    33         java::util::JavaOsLayer::startUpTrace(utf8, freeMem, totalMem);
       
    34         env->ReleaseStringUTFChars(header, utf8);
       
    35     }
       
    36     catch (java::util::ExceptionBase& ex)
       
    37     {
       
    38         ELOG1(EUtils,"%s",ex.toString().c_str());
       
    39     }
       
    40     catch (...)
       
    41     {
       
    42         ELOG(EUtils,"ERROR!!! MidpRuntime.getLocale(): Unexpected exception was caught");
       
    43     }
       
    44 }