RSysMonSession Class Reference
class RSysMonSession : public RSessionBase |
Client API for monitoring the applications and processes using System Monitor Client can use this class to register for process/application monitoring. Upon failure of the process/application, System Monitor will try to restart the process according to the supplied parameters. If the process still fail to start after the retry limit is reached or if the relaunch attempts exceeds the rate of failure policy, the recovery action will be taken. The retry action can be ignore failure, restart the system, or restart the system with a specified startup mode, and different PlatSec capability is required for each option. See API description for PlatSec capability required.
Inherited Functions |
---|
| RHandleBase::Attributes()const |
| RHandleBase::BTraceId()const |
| RHandleBase::DoExtendedClose() |
| RHandleBase::Duplicate(const RThread &,TOwnerType) |
| RHandleBase::FullName()const |
| RHandleBase::FullName(TDes &)const |
| RHandleBase::Handle()const |
| RHandleBase::HandleInfo(THandleInfo *) |
| RHandleBase::Name()const |
| RHandleBase::NotifyDestruction(TRequestStatus &) |
| RHandleBase::Open(const TFindHandleBase &,TOwnerType) |
| RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt) |
| RHandleBase::RHandleBase() |
| RHandleBase::RHandleBase(TInt) |
| RHandleBase::SetHandle(TInt) |
| RHandleBase::SetHandleNC(TInt) |
| RSessionBase::CreateSession(RServer2,const TVersion &) |
| RSessionBase::CreateSession(RServer2,const TVersion &,TInt) |
| RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *) |
| RSessionBase::CreateSession(const TDesC &,const TVersion &) |
| RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt) |
| RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *) |
| RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *) |
| RSessionBase::Open(RMessagePtr2,TInt,TOwnerType) |
| RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType) |
| RSessionBase::Open(TInt,TOwnerType) |
| RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType) |
| RSessionBase::Send(TInt)const |
| RSessionBase::Send(TInt,const TIpcArgs &)const |
| RSessionBase::SendReceive(TInt)const |
| RSessionBase::SendReceive(TInt,TRequestStatus &)const |
| RSessionBase::SendReceive(TInt,const TIpcArgs &)const |
| RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const |
| RSessionBase::SetReturnedHandle(TInt) |
| RSessionBase::SetReturnedHandle(TInt,RHandleBase &) |
| RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &) |
| RSessionBase::ShareAuto() |
| RSessionBase::ShareProtected() |
Constructor & Destructor Documentation
Member Functions Documentation
CancelAllMonitors()
IMPORT_C TInt | CancelAllMonitors | ( | ) | |
Used to cancel monitoring of all the components during device shutdown/fail
This function is to be called only by the ssm server. By calling this function early during device shutdown/fail, System Monitor will cancel all the outstanding monitor requests for all the components so that it will not restart them after the application finally exit during the device shutdown.
CancelMonitorSelfL()
IMPORT_C void | CancelMonitorSelfL | ( | ) | |
Used to cancel self-monitoring of a component.
This function is to be called by the component being monitored either by calling MonitorL() or MonitorSelfL() function. By calling this function before exiting, System Monitor will cancel the monitor request of the component so that System Monitor will not restart it after it exit.
ChangeToOldStylePropertiesL(const CSsmStartupProperties &)
Close()
Closes connection with SysMonServer
DoMonitorL(const CStartupProperties &, const RProcess *, TBool)
MonitorL(const CStartupProperties &, const RProcess &, TBool)
Used to initiate the monitoring of a started component using
CStartupProperties. Example use:
CStartupProperties* prop = CStartupProperties::NewLC(KFilename, KNullDesC);
prop->SetMonitored(ETrue);
prop->SetStartupType(EStartApp);
prop->SetStartMethod(EWaitForStart);
prop->SetNoOfRetries(1);
prop->SetTimeout(1000);
prop->SetRecoveryParams(EIgnoreOnFailure, 0);
iMySysMonSession.MonitorL(*prop, process);
CleanupStack::PopAndDestroy(prop);
Parameters
const CStartupProperties & aStartupProperties | Properties for the component to be monitored. Number of retries and timeout in aStartupProperties should only be used with start-method EWaitForStart or EFireAndForget. Start-method EDeferredWaitForStart can not be used for monitoring. |
const RProcess & aProcess | The running instance of the component to be monitored. |
TBool aExecuteRecoveryMethodOnFailure = EFalse | Gives the option to initiate monitoring on an already dead process. If the process is already dead, the monitor will be scheduled to recover the process. The default behaviour is to leave and not allow monitoring to be setup if the process is already dead. |
MonitorL(const CSsmStartupProperties &, const RProcess &, TBool)
Used to initiate the monitoring of a started component using
CSsmStartupProperties Example use:
CSsmStartupProperties* prop = CSsmStartupProperties::NewLC(KFilename, KNullDesC);
prop->SetCommandTypeL(ESsmCmdStartApp);
prop->SetExecutionBehaviour(ESsmWaitForSignal);
prop->SetMonitorInfo(ESsmIgnoreOnFailure, 0, 1000, 1);
iMySysMonSession.MonitorL(*prop, process);
CleanupStack::PopAndDestroy(prop);
-
capability
- ECapabilityProtServ
-
capability
- ECapabilityPowerMgmt for ERestartOSWithMode
-
leave
- KErrDied if aProcess is no longer running and aExecuteRecoveryMethodOnFailure is false
-
leave
- KErrArgument if aSsmStartupProperties contains invalid argument or if aProcess contain NULL handle
-
leave
- KErrPermissionDenied if client does not have the requied PlatSec capability
-
leave
- KErrAlreadyExists if the process is already registered for monitoring
Parameters
const CSsmStartupProperties & aSsmStartupProperties | Properties for the component to be monitored. Number of retries and timeout in aSsmStartupProperties should only be used with start-method ESsmWaitForSignal or ESsmFireAndForget. Start-method ESsmDeferredWaitForSignal can not be used for monitoring. |
const RProcess & aProcess | The running instance of the component to be monitored. |
TBool aExecuteRecoveryMethodOnFailure = EFalse | Gives the option to initiate monitoring on an already dead process. If the process is already dead, the monitor will be scheduled to recover the process. The default behaviour is to leave and not allow monitoring to be setup if the process is already dead. |
MonitorSelfL(const CStartupProperties &)
Used by a started component to initiate self-monitoring using CStartupProperties.
-
capability
- ECapabilityProtServ for ERestartOS ,ERestartOSWithMode and ECriticalNoRetries
-
capability
- ECapabilityPowerMgmt for ERestartOSWithMode
Instead of this use
RSysMonSession::MonitorSelfL(const CSsmStartupProperties& aSsmStartupProperties) - leave
- KErrArgument if aStartupProperties contains invalid argument or if aProcess contain NULL handle
- leave
- KErrPermissionDenied if client does not have the requied PlatSec capability
- leave
- KErrAlreadyExists if the process is already registered for monitoring
Parameters
const CStartupProperties & aStartupProperties | Properties for itself. Number of retries and timeout in aStartupProperties should only be used with start-method EWaitForStart or EFireAndForget. Start-method EDeferredWaitForStart can not be used for monitoring. |
MonitorSelfL(const CSsmStartupProperties &)
Used by a started component to initiate self-monitoring using CSsmStartupProperties
-
capability
- ECapabilityProtServ for ERestartOS ,ERestartOSWithMode and ECriticalNoRetries
-
capability
- ECapabilityPowerMgmt for ERestartOSWithMode
-
leave
- KErrArgument if aSsmStartupProperties contains invalid argument or if aProcess contain NULL handle
-
leave
- KErrPermissionDenied if client does not have the requied PlatSec capability
-
leave
- KErrAlreadyExists if the process is already registered for monitoring
Parameters
const CSsmStartupProperties & aSsmStartupProperties | Properties for itself. Number of retries and timeout in aSsmStartupProperties should only be used with start-method ESsmWaitForSignal or ESsmFireAndForget. Start-method ESsmDeferredWaitForSignal can not be used for monitoring. |
OpenL()
Opens connection with SysMonServer
Validate(const CStartupProperties &)
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.