CStartSafe Class Reference
class CStartSafe : 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. Instead of this use CSsmStartSafe
Private Member Functions
|
|
CStartSafe
()
|
TInt
|
AwaitProcessStartup
(
RProcess
&,
TInt
,
TRequestStatus
&)
|
TInt
|
AwaitRendezvous
(
RProcess
&,
TInt
)
|
void
|
ConstructL
()
|
void
|
DoFireAndForgetL
(const
CStartupProperties
&,
RProcess
&)
|
void
|
DoStartAppL
(const
CStartupProperties
&,
RProcess
&)
|
TInt
|
DoStartAppWithRetries
(const
CStartupProperties
&,
RProcess
&,
TInt
&)
|
void
|
DoStartProcessL
(const
CStartupProperties
&,
RProcess
&)
|
TInt
|
DoStartProcessWithRetries
(const
CStartupProperties
&,
RProcess
&,
TInt
&)
|
void
|
DoWaitForStartL
(const
CStartupProperties
&,
RProcess
&,
TInt
&)
|
void
|
GetHandleAndWaitForProcessL
(const
CStartupProperties
&,
RProcess
&,
TThreadId
&,
TRequestStatus
&)
|
void
|
GetProcessHandleL
(
RProcess
&, const
TThreadId
&)
|
void
|
InstituteRestartL
(const
CStartupProperties
&)
|
void
|
LoadApStartLibL
()
|
void
|
ShootBadProcess
(
RProcess
&, const
TRequestStatus
&)
|
Constructor & Destructor Documentation
~CStartSafe()
~CStartSafe
|
(
|
)
|
[virtual]
|
Member Functions Documentation
AwaitProcessStartup(RProcess &, TInt, TRequestStatus &)
Await completion of the TRS either unconditionally, or allow aTimeout for aProcess to start.
AwaitRendezvous(RProcess &, TInt)
ConstructL()
void
|
ConstructL
|
(
|
)
|
[private]
|
DoFireAndForgetL(const CStartupProperties &, RProcess &)
DoStartAppL(const CStartupProperties &, RProcess &)
DoStartAppWithRetries(const CStartupProperties &, RProcess &, TInt &)
DoStartProcessL(const CStartupProperties &, RProcess &)
DoStartProcessWithRetries(const CStartupProperties &, RProcess &, TInt &)
DoWaitForStartL(const CStartupProperties &, RProcess &, TInt &)
GetHandleAndWaitForProcessL(const CStartupProperties &, RProcess &, TThreadId &, TRequestStatus &)
GetProcessHandleL(RProcess &, const TThreadId &)
void
|
GetProcessHandleL
|
(
|
RProcess
&
|
aProcess,
|
|
const
TThreadId
&
|
aThreadId
|
|
)
|
[private]
|
InitAppArcServer(TRequestStatus &)
Waits for AppArc Server initialise. Note: This function is synchronous.
InstituteRestartL(const CStartupProperties &)
Make a call to restart the system.
RestartSys
currently requires the guard-time KStartSafeRestartTimeout. The Leave() should never eventuate, except in case of a restart problem.
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 is not closely specified in
RLibrary
docs or code.
ShootBadProcess(RProcess &, const TRequestStatus &)
See if the process rendezvoused with an error code and is still alive. If so then Kill() it.
StartAndMonitorL(const CStartupProperties &, RProcess &, TInt &)
Used to start a process or application and initiate monitoring. Use this for EFireAndForget or EWaitForStart. The case of EDeferredWaitForStart is treated as for EFireAndForget. 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.
-
leave
-
Another of the system-wide error codes
Parameters
const
CStartupProperties
& aStartupProperties
|
Startup properties provided by the caller.
|
RProcess
& aProcess
|
The newly created process.
|
TInt
& aNumRetried
|
The number of retries made in starting the process.
|
StartL(const CStartupProperties &, RProcess &, TInt &)
Used to start a process or application using EFireAndForget or EWaitForStart. The case of EDeferredWaitForStart is treated as EFireAndForget.
-
panic
-
ETimerValueInvalid if the timer value is invalid(<0)
-
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
-
KErrAbort if the startup and rendezvous was unsuccessful _and the call to restart the system was also unsuccessful. Otherwise,one of the system-wide error codes
Parameters
const
CStartupProperties
& aStartupProperties
|
Startup properties provided by the caller.
|
RProcess
& aProcess
|
The newly created process.
|
TInt
& aNumRetried
|
Number of retries made for starting the process.
|
StartL(const CStartupProperties &, RProcess &, TRequestStatus &)
Used to start a process or application using EDeferredWaitForStart. Note: Retries are not attempted in this asynchronous form of the function.
-
leave
-
KErrNotSupported if ApStart is not installed on the device.
-
leave
-
KErrArgument if the
CStartupProperties
StartupType is not recognised, otherwise one of the system-wide error codes
Parameters
const
CStartupProperties
& aStartupProperties
|
Startup properties provided by the caller.
|
RProcess
& aProcess
|
The newly created process.
|
TRequestStatus
& aCommandTrs
|
The request-status which is completed by the process rendezvous, or by this function in case of error.
|
Member Data Documentation
CApaStarter * iApaStarter
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.