javaruntimes/jvmargmodifier/file/src/jvmargsmodifier.cpp
branchRCL_3
changeset 83 26b2b12093af
parent 71 d5e927d5853b
equal deleted inserted replaced
77:7cee158cb8cd 83:26b2b12093af
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  A file argument reader implementation for JvmArgs modifier.
    14 * Description:  A default empty implementation for JvmArgs modifier.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <algorithm>
    18 #include <algorithm>
    19 
    19 
    21 #include "logger.h"
    21 #include "logger.h"
    22 
    22 
    23 #include "jvmargsfilereader.h"
    23 #include "jvmargsfilereader.h"
    24 #include "argsmodifier.h"
    24 #include "argsmodifier.h"
    25 
    25 
       
    26 #ifdef __SYMBIAN32__
       
    27 #include <AknGlobalNote.h>
       
    28 _LIT(KArgsTxt, "Note! Modified VM arguments used!");
       
    29 #endif
       
    30 
    26 void logArguments(std::wstring aArg)
    31 void logArguments(std::wstring aArg)
    27 {
    32 {
    28     WLOG1(EJavaRuntime, " '%S'", aArg.c_str());
    33     WLOG1(EJavaRuntime, " '%S'", aArg.c_str());
    29 }
    34 }
       
    35 
       
    36 #ifdef __SYMBIAN32__
       
    37 void showWarningDialogL()
       
    38 {
       
    39     ::CAknGlobalNote* globalNote = CAknGlobalNote::NewL();
       
    40     CleanupStack::PushL(globalNote);
       
    41     globalNote->ShowNoteL(EAknGlobalInformationNote, KArgsTxt);
       
    42     CleanupStack::PopAndDestroy(globalNote);
       
    43 }
       
    44 #endif
       
    45 
    30 
    46 
    31 OS_EXPORT
    47 OS_EXPORT
    32 void java::runtime::modifyJvmArguments(const std::wstring& aIdentifier,
    48 void java::runtime::modifyJvmArguments(const std::wstring& aIdentifier,
    33                                        std::list<std::wstring>& aJvmArgs,
    49                                        std::list<std::wstring>& aJvmArgs,
    34                                        std::list<std::wstring>& aApplicationAndArgs)
    50                                        std::list<std::wstring>& aApplicationAndArgs)
    35 {
    51 {
    36     PLOG(EJavaRuntime, "JVM File Argument modifier in use");
    52     JELOG2(EJavaRuntime);
    37 
    53 
    38 #ifdef __SYMBIAN32__
    54 #ifdef __SYMBIAN32__
    39     // Open the extension directory of the J9 VM.
    55     // Open the extension directory of the J9 VM.
    40     aJvmArgs.push_back(L"-Dcom.ibm.j9.ext.dirs=c:\\resource\\java\\jvm\\lib\\common;z:\\resource\\java\\jvm\\lib\\common");
    56     aJvmArgs.push_back(L"-Dcom.ibm.j9.ext.dirs=c:\\resource\\java\\jvm\\lib\\common;z:\\resource\\java\\jvm\\lib\\common");
    41 #endif
    57 #endif
    52     {
    68     {
    53         WLOG(EJavaRuntime, "new JVM arguments");
    69         WLOG(EJavaRuntime, "new JVM arguments");
    54         std::for_each(aJvmArgs.begin(), aJvmArgs.end(), logArguments);
    70         std::for_each(aJvmArgs.begin(), aJvmArgs.end(), logArguments);
    55         WLOG(EJavaRuntime, "new App arguments");
    71         WLOG(EJavaRuntime, "new App arguments");
    56         std::for_each(aApplicationAndArgs.begin(), aApplicationAndArgs.end(), logArguments);
    72         std::for_each(aApplicationAndArgs.begin(), aApplicationAndArgs.end(), logArguments);
       
    73 #ifdef __SYMBIAN32__
       
    74         TRAP_IGNORE(showWarningDialogL());
       
    75 #endif
    57     }
    76     }
    58 }
    77 }
    59 
    78