CStartupProperties Class Reference
class CStartupProperties : public CBase |
A parameter class containing application/process starter information that is shared among client applications, system components and client/server processes. This class is used to pass multiple different types of data to API's in only one parameter while ensuring proper data initialization, memory allocation and serializing over IPC when required.
When an instance of this class is created it contains default values for all properties. The usage of this class for different scenarios only requires calling setter functions to overrride parameters which has non-default values.
Instead of this use CSsmStartupProperties
Nested Classes and Structures
Constructor & Destructor Documentation
CStartupProperties()
CStartupProperties | ( | ) | [private] |
~CStartupProperties()
IMPORT_C | ~CStartupProperties | ( | ) | |
Member Functions Documentation
ActionOnCommandFailure()
Accessor function returning the legacy fail_on_error property used by the old resource structs START_APP_INFO and START_PROCESS_INFO.
Args()
IMPORT_C TPtrC | Args | ( | ) | const |
Accessor function returning arguments property
ConstructFromResourceL(TResourceReader &)
ConstructL()
void | ConstructL | ( | ) | [private] |
DoSanityCheck(TStartupCommandType)
ExternalizeL(CBufBase &)
IMPORT_C void | ExternalizeL | ( | CBufBase & | aBufPtr | ) | const |
Externalize the class into a buffer. This function has to be updated every time a member has been added to the class to maintain binary compatibility.
Parameters
CBufBase & aBufPtr | A buffer of sufficient size to contain the externalized class data on function return |
FileName()
IMPORT_C TPtrC | FileName | ( | ) | const |
Accessor function returning filename property
InternalizeL(const TPtrC8 &)
IMPORT_C void | InternalizeL | ( | const TPtrC8 & | aBufPtr | ) | |
Internalize the class from a buffer. This function has to be updated every time a member has been added to the class to maintain binary compatibility.
Parameters
const TPtrC8 & aBufPtr | A buffer containing the externalized class data |
Monitored()
IMPORT_C TBool | Monitored | ( | ) | const |
Accessor function returning monitored property
NewL(const TDesC &, const TDesC &)
Used to create an instance of CStartupProperties class with the specified process filename and arguments.
Parameters
const TDesC & aFileName | A file name containing full path to be used to start up a component. |
const TDesC & aArgs | A string that will be used as an argument to the component when starting. |
NewL(TResourceReader &)
Used to create an instance of
CStartupProperties class from a resource definition. Supported resource structs are
START_PROCESS_INFO,
START_PROCESS_INFO2,
START_APP_INFO and
START_APP_INFO2.
- panic
- EInvalidCommandType if the Command type is invalid
- panic
- EInvalidStartMethod if the start method is invalid
- panic
- EInvalidTimeout if start method is not EWaitForStart then timeout value should be zero
- panic
- EInvalidNoOfRetries if start method is not EWaitForStart then no_of_retries should be zero
- panic
- EInvalidRecoveryMethod if the Recovery method called after a command failure is invalid
Parameters
TResourceReader & aSource | The resource reader with which to access the resource values |
NewLC(const TDesC &, const TDesC &)
NoOfRetries()
IMPORT_C TInt | NoOfRetries | ( | ) | const |
Accessor function returning number of retries property. Only valid when TStartMethod = EWaitForStart.
RecoveryMethod()
Accessor function returning recovery method property read from the retry_failure_recovery_method property in the resource structs START_PROCESS_INFO2 and START_APP_INFO2.
Reset()
Reset all variables in this instance back to constructor defaults.
RestartMode()
IMPORT_C TInt | RestartMode | ( | ) | const |
Accessor function returning restart mode property
SetActionOnCommandFailure(TActionOnCommandFailure)
Action to be taken on command failure. Provides backward compatibility with earlier SSC format. Used to set the fail_on_error fields within START_PROCESS_INFO, START_APP_INFO, START_DLL_INFO, and MULTIPLE_WAIT structures.
SetFileParamsL(const TDesC &, const TDesC &)
IMPORT_C void | SetFileParamsL | ( | const TDesC & | aFileName, |
| const TDesC & | aArgs |
| ) | |
Parameters
const TDesC & aFileName | A file name containing full path to be used to start up a component. |
const TDesC & aArgs | A string that will be used as an argument to the component when starting. |
SetMonitored(TBool)
IMPORT_C void | SetMonitored | ( | TBool | aMonitored | ) | |
Sets the monitoring parameter. Monitoring a component means the System Monitor server observes the component and takes action when it exits. When a monitored component exits, the System Monitor server will try to restart it the number of times specified in NoOfRetries. If the number of retries is 0, or the number of retries have been exhausted, the TRecoveryMethod is executed.
Parameters
TBool aMonitored | ETrue if the component should be monitored for failure |
SetNoOfRetries(TInt)
IMPORT_C void | SetNoOfRetries | ( | TInt | aNumRetries | ) | |
Sets failure parameter NoOfRetries. Only valid when TStartMethod = EWaitForStart.
Parameters
TInt aNumRetries | Number of retries to attempt if the component fails to start for the first time during system startup. Also determines if a monitored component should be restarted when it fails. Only valid when TStartMethod = EWaitForStart. |
SetRecoveryParams(TRecoveryMethod, TInt)
Sets recovery parameters. When a component being monitored exits and the system fails to restart the component within the specified number of retries, the TRecoveryMethod is executed. Used to set the retry_failure_recovery_method within START_PROCESS_INFO2 and START_APP_INFO2 structures.
Parameters
TRecoveryMethod aRecoveryMethod | The method to use to recover when a monitored component fails. |
TInt aRestartMode | The startup mode to restart the OS if recovery method is ERestartOSWithMode. If aRecoveryMethod==ERestartOS this parameter should be zero. |
SetStartInBackground(TBool)
IMPORT_C void | SetStartInBackground | ( | TBool | aStartInBackground | ) | |
Sets extra startup start in background parameter only needed if starting an application
Parameters
TBool aStartInBackground | ETrue if the application should start in the background |
SetStartMethod(TStartMethod)
Sets startup method parameter.
Parameters
TStartMethod aStartMethod | The method to be used to start up the component. |
SetStartupType(TStartupType)
Sets startup type parameter
Parameters
TStartupType aType | EStartProcess for starting processes, EStartApp for starting applications |
SetTimeout(TInt)
IMPORT_C void | SetTimeout | ( | TInt | aTimeout | ) | |
Sets failure parameter Timeout. Used together with start-method EWaitStart to determine how long to wait for the component being started to rendevouz before aborting an attempt.
Parameters
TInt aTimeout | The time in milliseconds to wait before terminating a component that's taking longer to start (rendezvouz) than this specified timeout value. A value of zero means "do not time this component out". Only valid when TStartMethod = EWaitForStart. |
SetViewless(TBool)
IMPORT_C void | SetViewless | ( | TBool | aViewless | ) | |
Sets extra startup viewless parameter only needed if starting an application
Parameters
TBool aViewless | ETrue if the application should be viewless |
StartInBackground()
IMPORT_C TBool | StartInBackground | ( | ) | const |
Accessor function returning start in background property
StartMethod()
Accessor function returning start method property
StartupType()
Accessor function returning startup type property
Timeout()
IMPORT_C TInt | Timeout | ( | ) | const |
Accessor function returning timeout property. Only valid when TStartMethod = EWaitForStart.
Version()
IMPORT_C TInt | Version | ( | ) | const |
Accessor function returning internal version of the parameter object
Viewless()
IMPORT_C TBool | Viewless | ( | ) | const |
Accessor function returning viewless property
Member Data Documentation
HBufC * iFileName
HBufC * | iFileName | [private] |
TBool
iMonitored
TBool
| iMonitored | [private] |
Whether the application should be monitored
TInt
iNoOfRetries
TInt
| iNoOfRetries | [private] |
No of retries if the server/app/process fails to start
TRecoveryPolicy
iRecoveryMethod
How to recover monitored application
TInt
iRestartMode
TInt
| iRestartMode | [private] |
Which startup mode to restart the OS if recovery mode is RestartOSWithMode
TBool
iStartInBackground
TBool
| iStartInBackground | [private] |
Whether the application should be started in the background.
TStartMethod
iStartMethod
Whether system starter should wait for application to signal completion or use 'fire and forget' mode.
TStartupType
iStartupType
What to start, application or process.
TInt
iTimeout
Whether to kill a process that's taking too long. a value of zero means "do not time this process out".
TBool
iViewless
Whether the application should be started viewless.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.