|
1 /* |
|
2 * Copyright (c) 2008 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: MidpRuntime |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "logger.h" |
|
20 #include "javacommonutils.h" |
|
21 #include "midpruntimearguments.h" |
|
22 |
|
23 #include "midpruntime.h" |
|
24 |
|
25 #include "javaprocessconstants.h" |
|
26 |
|
27 namespace java |
|
28 { |
|
29 namespace captain |
|
30 { |
|
31 |
|
32 MidpRuntime::MidpRuntime(const Uid& aUID, CoreInterface* aCore) |
|
33 :RtcBasePlugin(aUID, aCore) |
|
34 { |
|
35 JELOG4(EJavaCaptain, EInfoHeavyLoad); |
|
36 } |
|
37 |
|
38 MidpRuntime::~MidpRuntime() |
|
39 { |
|
40 JELOG4(EJavaCaptain, EInfoHeavyLoad); |
|
41 } |
|
42 |
|
43 cmdLine_t& MidpRuntime::generateCommandLine(const int& aLaunchType, |
|
44 cmdLine_t& params) |
|
45 { |
|
46 JELOG4(EJavaCaptain, EInfoHeavyLoad); |
|
47 |
|
48 params.push_back(java::runtime::JAVA_PROCESS); |
|
49 params.push_back(java::runtime::JAVA_MIDP_STARTER_DLL); //The name of the dll, that runs MIDlets |
|
50 |
|
51 if (aLaunchType == RTC_LAUNCH_TYPE_PREWARM_C) |
|
52 { |
|
53 params.push_back(java::runtime::PREWARM_ARGUMENT); |
|
54 } |
|
55 else |
|
56 { |
|
57 params.push_back(java::runtime::APP_UID_ARGUMENT); |
|
58 char* appUID = java::util::JavaCommonUtils::wstringToUtf8(mUID.toString()); |
|
59 params.push_back(appUID); |
|
60 delete [] appUID; |
|
61 |
|
62 if (aLaunchType == RTC_LAUNCH_TYPE_DEBUG_C || |
|
63 !mRuntimeArguments.empty()) |
|
64 { |
|
65 params.push_back(java::runtime::DEBUG_ARGUMENT); |
|
66 } |
|
67 |
|
68 if (!mApplicationArguments.empty()) |
|
69 { |
|
70 params.push_back(java::runtime::EXTRA_ARGUMENTS); |
|
71 } |
|
72 |
|
73 switch (aLaunchType) |
|
74 { |
|
75 case RTC_LAUNCH_TYPE_PUSH_C: |
|
76 params.push_back(java::runtime::PUSH_ARGUMENT); |
|
77 break; |
|
78 |
|
79 case RTC_LAUNCH_TYPE_AUTO_INVOCATION_C: |
|
80 params.push_back(java::runtime::AUTO_INVOCATION_ARGUMENT); |
|
81 break; |
|
82 |
|
83 case RTC_LAUNCH_TYPE_BACKGROUND_C: |
|
84 params.push_back(java::runtime::BG_START_ARGUMENT); |
|
85 break; |
|
86 |
|
87 // fall through |
|
88 case RTC_LAUNCH_TYPE_NORMAL_C: |
|
89 case RTC_LAUNCH_TYPE_DEBUG_C: |
|
90 default: |
|
91 break; |
|
92 } |
|
93 } |
|
94 |
|
95 return params; |
|
96 } |
|
97 |
|
98 } // namespace captain |
|
99 } // namespace java |
|
100 |