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

Inherits from

Nested Classes and Structures

Public Member Functions
~CStartupProperties()
IMPORT_C TActionOnCommandFailureActionOnCommandFailure()
IMPORT_C TPtrCArgs()
IMPORT_C voidExternalizeL(CBufBase &)
IMPORT_C TPtrCFileName()
IMPORT_C voidInternalizeL(const TPtrC8 &)
IMPORT_C TBoolMonitored()
IMPORT_C CStartupProperties *NewL()
IMPORT_C CStartupProperties *NewL(const TDesC &, const TDesC &)
IMPORT_C CStartupProperties *NewL(TResourceReader &)
IMPORT_C CStartupProperties *NewLC()
IMPORT_C CStartupProperties *NewLC(const TDesC &, const TDesC &)
IMPORT_C CStartupProperties *NewLC(TResourceReader &)
IMPORT_C TIntNoOfRetries()
IMPORT_C TRecoveryMethodRecoveryMethod()
IMPORT_C voidReset()
IMPORT_C TIntRestartMode()
IMPORT_C voidSetActionOnCommandFailure(TActionOnCommandFailure)
IMPORT_C voidSetFileParamsL(const TDesC &, const TDesC &)
IMPORT_C voidSetMonitored(TBool)
IMPORT_C voidSetNoOfRetries(TInt)
IMPORT_C voidSetRecoveryParams(TRecoveryMethod, TInt)
IMPORT_C voidSetStartInBackground(TBool)
IMPORT_C voidSetStartMethod(TStartMethod)
IMPORT_C voidSetStartupType(TStartupType)
IMPORT_C voidSetTimeout(TInt)
IMPORT_C voidSetViewless(TBool)
IMPORT_C TIntSize()
IMPORT_C TBoolStartInBackground()
IMPORT_C TStartMethodStartMethod()
IMPORT_C TStartupTypeStartupType()
IMPORT_C TIntTimeout()
IMPORT_C TIntVersion()
IMPORT_C TBoolViewless()
Private Member Functions
CStartupProperties()
voidConstructFromResourceL(TResourceReader &)
voidConstructL()
voidDoSanityCheck(TStartupCommandType)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
HBufC *iArgs
HBufC *iFileName
TBool iMonitored
TInt iNoOfRetries
TRecoveryPolicy iRecoveryMethod
TInt iRestartMode
TBool iStartInBackground
TStartMethod iStartMethod
TStartupType iStartupType
TInt iTimeout
TInt iVersion
TBool iViewless

Constructor & Destructor Documentation

CStartupProperties()

CStartupProperties()[private]

~CStartupProperties()

IMPORT_C~CStartupProperties()

Destructor for CStartupProperties class

Member Functions Documentation

ActionOnCommandFailure()

IMPORT_C TActionOnCommandFailureActionOnCommandFailure()const

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 TPtrCArgs()const

Accessor function returning arguments property

ConstructFromResourceL(TResourceReader &)

voidConstructFromResourceL(TResourceReader &aSource)[private]

Parameters

TResourceReader & aSource

ConstructL()

voidConstructL()[private]

DoSanityCheck(TStartupCommandType)

voidDoSanityCheck(TStartupCommandTypeaCommandType)const [private]

Parameters

TStartupCommandType aCommandType

ExternalizeL(CBufBase &)

IMPORT_C voidExternalizeL(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 & aBufPtrA buffer of sufficient size to contain the externalized class data on function return

FileName()

IMPORT_C TPtrCFileName()const

Accessor function returning filename property

InternalizeL(const TPtrC8 &)

IMPORT_C voidInternalizeL(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 & aBufPtrA buffer containing the externalized class data

Monitored()

IMPORT_C TBoolMonitored()const

Accessor function returning monitored property

NewL()

IMPORT_C CStartupProperties *NewL()[static]

Used to create an instance of CStartupProperties class.

NewL(const TDesC &, const TDesC &)

IMPORT_C CStartupProperties *NewL(const TDesC &aFileName,
const TDesC &aArgs
)[static]

Used to create an instance of CStartupProperties class with the specified process filename and arguments.

Parameters

const TDesC & aFileNameA file name containing full path to be used to start up a component.
const TDesC & aArgsA string that will be used as an argument to the component when starting.

NewL(TResourceReader &)

IMPORT_C CStartupProperties *NewL(TResourceReader &aSource)[static]
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 & aSourceThe resource reader with which to access the resource values

NewLC()

IMPORT_C CStartupProperties *NewLC()[static]

Used to create an instance of CStartupProperties class. The new instance is put on the CleanupStack.

NewLC(const TDesC &, const TDesC &)

IMPORT_C CStartupProperties *NewLC(const TDesC &aFileName,
const TDesC &aArgs
)[static]

Used to create an instance of CStartupProperties class with the specified process filename and arguments. The new instance is pushed onto the CleanupStack. CStartupProperties::NewL(const TDesC& aFileName, const TDesC& aArgs)

Parameters

const TDesC & aFileName
const TDesC & aArgs

NewLC(TResourceReader &)

IMPORT_C CStartupProperties *NewLC(TResourceReader &aSource)[static]

Used to create an instance of CStartupProperties class from a resource definition. The new instance is put on the CleanupStack. CStartupProperties::NewL(TResourceReader& aResourceReader)

Parameters

TResourceReader & aSource

NoOfRetries()

IMPORT_C TIntNoOfRetries()const

Accessor function returning number of retries property. Only valid when TStartMethod = EWaitForStart.

RecoveryMethod()

IMPORT_C TRecoveryMethodRecoveryMethod()const

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()

IMPORT_C voidReset()

Reset all variables in this instance back to constructor defaults.

RestartMode()

IMPORT_C TIntRestartMode()const

Accessor function returning restart mode property

SetActionOnCommandFailure(TActionOnCommandFailure)

IMPORT_C voidSetActionOnCommandFailure(TActionOnCommandFailureaActionOnCommandFailure)

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.

Parameters

TActionOnCommandFailure aActionOnCommandFailureAction to be taken if the system starter command fails.

SetFileParamsL(const TDesC &, const TDesC &)

IMPORT_C voidSetFileParamsL(const TDesC &aFileName,
const TDesC &aArgs
)

Sets file parameters

Parameters

const TDesC & aFileNameA file name containing full path to be used to start up a component.
const TDesC & aArgsA string that will be used as an argument to the component when starting.

SetMonitored(TBool)

IMPORT_C voidSetMonitored(TBoolaMonitored)

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 aMonitoredETrue if the component should be monitored for failure

SetNoOfRetries(TInt)

IMPORT_C voidSetNoOfRetries(TIntaNumRetries)

Sets failure parameter NoOfRetries. Only valid when TStartMethod = EWaitForStart.

Parameters

TInt aNumRetriesNumber 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)

IMPORT_C voidSetRecoveryParams(TRecoveryMethodaRecoveryMethod,
TIntaRestartMode
)

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 aRecoveryMethodThe method to use to recover when a monitored component fails.
TInt aRestartModeThe startup mode to restart the OS if recovery method is ERestartOSWithMode. If aRecoveryMethod==ERestartOS this parameter should be zero.

SetStartInBackground(TBool)

IMPORT_C voidSetStartInBackground(TBoolaStartInBackground)

Sets extra startup start in background parameter only needed if starting an application

Parameters

TBool aStartInBackgroundETrue if the application should start in the background

SetStartMethod(TStartMethod)

IMPORT_C voidSetStartMethod(TStartMethodaStartMethod)

Sets startup method parameter.

Parameters

TStartMethod aStartMethodThe method to be used to start up the component.

SetStartupType(TStartupType)

IMPORT_C voidSetStartupType(TStartupTypeaType)

Sets startup type parameter

Parameters

TStartupType aTypeEStartProcess for starting processes, EStartApp for starting applications

SetTimeout(TInt)

IMPORT_C voidSetTimeout(TIntaTimeout)

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 aTimeoutThe 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 voidSetViewless(TBoolaViewless)

Sets extra startup viewless parameter only needed if starting an application

Parameters

TBool aViewlessETrue if the application should be viewless

Size()

IMPORT_C TIntSize()const

StartInBackground()

IMPORT_C TBoolStartInBackground()const

Accessor function returning start in background property

StartMethod()

IMPORT_C TStartMethodStartMethod()const

Accessor function returning start method property

StartupType()

IMPORT_C TStartupTypeStartupType()const

Accessor function returning startup type property

Timeout()

IMPORT_C TIntTimeout()const

Accessor function returning timeout property. Only valid when TStartMethod = EWaitForStart.

Version()

IMPORT_C TIntVersion()const

Accessor function returning internal version of the parameter object

Viewless()

IMPORT_C TBoolViewless()const

Accessor function returning viewless property

Member Data Documentation

HBufC * iArgs

HBufC *iArgs[private]

Application arguments

HBufC * iFileName

HBufC *iFileName[private]

Path to the application

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

TRecoveryPolicy iRecoveryMethod[private]

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

TStartMethod iStartMethod[private]

Whether system starter should wait for application to signal completion or use 'fire and forget' mode.

TStartupType iStartupType

TStartupType iStartupType[private]

What to start, application or process.

TInt iTimeout

TInt iTimeout[private]

Whether to kill a process that's taking too long. a value of zero means "do not time this process out".

TInt iVersion

TInt iVersion[private]

Internal version for the CStartupProperties object

TBool iViewless

TBool iViewless[private]

Whether the application should be started viewless.