CSsmStartSafe Class Reference

class CSsmStartSafe : public CBase

Used to start a process or application reliably. Which means, if the starting fails after designated number of attempts then system restarts or an error is returned.

Inherits from

Constructor & Destructor Documentation

CSsmStartSafe()

CSsmStartSafe ( ) [private]

~CSsmStartSafe()

~CSsmStartSafe ( )

Member Functions Documentation

CancellationComplete(TInt, TInt)

void CancellationComplete ( TInt aComplete,
TInt aCallerIndex
)

Parameters

TInt aComplete
TInt aCallerIndex

ConstructL()

void ConstructL ( ) [private]

DeRegisterCall(TInt)

TInt DeRegisterCall ( TInt aCallerIndex ) [private]

Parameters

TInt aCallerIndex

InitAppArcServer()

IMPORT_C TInt InitAppArcServer ( )

Waits for AppArc Server to initialise.

InitApparcServer(TRequestStatus &)

IMPORT_C void InitApparcServer ( TRequestStatus & aCommandTrs )

Async call to wait for Apparc Server to initialise.

Parameters

TRequestStatus & aCommandTrs The TRequestStatus which is completed when applist is populated.

InitApparcServerCancel()

IMPORT_C void InitApparcServerCancel ( )

Cancel Apparc Server initialization.

LoadApStartLibL()

void LoadApStartLibL ( ) [private]

Load the library. Locate and call the ordinal corresponding to CApStart::NewL().

Note: We do not leave in the case of being unable to load the libray, but assume Apparc is not present. iApaStarter is checked for NULL before use passim and appropriate error code supplied if it is. The return code is derived from the loader-server (Base) and not closely specified in RLibrary docs or code.

LoadMonitorProxyLibL()

void LoadMonitorProxyLibL ( ) [private]

Load the dll interfacing between us and the System Monitor component, if installed.

NewL()

IMPORT_C CSsmStartSafe * NewL ( ) [static]

Used to create an instance of CSsmStartSafe class

NewLC()

IMPORT_C CSsmStartSafe * NewLC ( ) [static]

RegisterCall(TInt &, TRequestStatus &)

TInt RegisterCall ( TInt & aCallerIndex,
TRequestStatus & aStatus
) [private]

Add the caller to the array of callers. Supply an index which identifies the caller. In the case a call to one of the cancel functions, the caller identifies themselves by this index.

Parameters

TInt & aCallerIndex
TRequestStatus & aStatus

RendezvousComplete(TInt, TInt)

void RendezvousComplete ( TInt aComplete,
TInt aCallerIndex
)

Parameters

TInt aComplete
TInt aCallerIndex

Start(const CSsmStartupProperties &, RProcess &, TRequestStatus &, TInt &)

IMPORT_C void Start ( const CSsmStartupProperties & aStartupProperties,
RProcess & aProcess,
TRequestStatus & aCommandTrs,
TInt & aCallerIndex
)

Asynchronous function to start a process or application.

Parameters

const CSsmStartupProperties & aStartupProperties The startup-properties defining the app or process to be started.
RProcess & aProcess Handle on the process to be created.
TRequestStatus & aCommandTrs The TRequestStatus which is completed as a result of the process rendezvous or any error arising from the attempt.
TInt & aCallerIndex The index integer supplied by this call. This value should be perserved and passed in the case of a call to StartCancel()

StartAndMonitorL(const CSsmStartupProperties &, RProcess &)

IMPORT_C void StartAndMonitorL ( const CSsmStartupProperties & aStartupProperties,
RProcess & aProcess
)

Used to start a process or application and initiate monitoring. Use this for ESsmWaitForSignal or ESsmDeferredWaitForSignal. The number-of-retries parameter in aStartupProperties applies to the startup procedure. If monitoring is not successfully setup, the started process is killed and this function leaves with the error code supplied by the system-monitor.

leave
KErrArgument if the monitor flag is not set in aStartupProperties, or if the execution behaviour is ESsmFireandForget.
leave
KErrNotSupported if the system monitor sub-system is not installed.
leave
Another of the system-wide error codes
StartL

Parameters

const CSsmStartupProperties & aStartupProperties Startup properties provided by the caller.
RProcess & aProcess Handle on the process to be created.

StartCancel(TInt &)

IMPORT_C void StartCancel ( TInt & aCallerIndex )

Calling cancel precipitates the destruction of the rendezvous-observer/timeoutwaiter. These are AOs and so cancellation of any outstanding rendezvous is implied.

Parameters

TInt & aCallerIndex the index value supplied by the async CSsmStartSafe::StartL(). This is set to a large negative value upon completion of the operation to guard against multiple calls, or KErrArgument if the index is out of range.

StartL(const CSsmStartupProperties &, RProcess &)

IMPORT_C void StartL ( const CSsmStartupProperties & aStartupProperties,
RProcess & aProcess
)

Synchronous function to start a process or application. Note: This API should be used only if one synchronous call to StartL at any one time can be assured.

leave
KErrNoMemory if no memory.
leave
KErrArgument if the TStartMethod enumeration in aStartupProperties is out of range.
leave
KErrTimedOut if the Application or process failed to rendezvous within the interval specified in aStartupProperties.
leave
Or one of the system-wide error codes

Parameters

const CSsmStartupProperties & aStartupProperties Startup properties provided by the caller.
RProcess & aProcess Handle on the process to be created.

Member Data Documentation

RLibrary iApStartLib

RLibrary iApStartLib [private]

CApaStarter * iApaStarter

CApaStarter * iApaStarter [private]

TInt iCallerCount

TInt iCallerCount [private]

RArray< TSsmStartSafeEntry > iStartSafeEntryArray

RArray < TSsmStartSafeEntry > iStartSafeEntryArray [private]

MSsmLoadSysMon * iSysMonCli

MSsmLoadSysMon * iSysMonCli [private]

RLibrary iSysMonProxyLib

RLibrary iSysMonProxyLib [private]