CBindManager Class Reference

class CBindManager : public CBase

Inherits from

Nested Classes and Structures

Public Member Functions
~CBindManager()
voidBindSubmodulesL(TRequestStatus &, const TRSBindType, const TCFSubModuleAddress &, const TCFSubModuleAddress &, TInt, TInt)
TInt Cancel(TRequestStatus &)
voidCreateModuleL(TRequestStatus &, const TCFModuleNameF &, const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)
TInt EnumerateBindings(const TCFSubModuleAddress &, TBool, TBindingInfo &)
TInt EnumerateSubModules(const TCFModuleNameF &, TInt, TCFSubModuleNameF &)
voidJobTimedOut(const TCFModuleNameF &, const TUint)
voidModuleEndedL(const TCFModuleNameF &)
CBindManager *NewL(MRootServerNotify &)
TInt NumSubModules(const TCFModuleNameF &, TInt &)
voidReceivedMessage(const TCFModuleNameF &, const TCFMessage &)
voidSendL(const TCFModuleNameF &, const RMessage2 &)
voidTaskCompleted(CModule &, const CTask &, TInt)
voidUnbindAllAndShutDownL(TRequestStatus &, const TCFModuleNameF &, TCFShutdownType)
voidUnbindAlreadyDeadL(TRequestStatus &, const TCFModuleNameF &)
voidUnbindSubmodulesL(TRequestStatus &, const TCFSubModuleAddress &, const TCFSubModuleAddress &)
Private Member Functions
CBindManager()
voidConstructL()
voidConvertRSBindType(const TRSBindType, TCFBindType &, TCFBindType &)
CBindInfo *FindBindInfo(const TCFSubModuleAddress &, const TCFSubModuleAddress &)
CModule *GetModulePtrL(const TCFModuleNameF &)
CModule *GetModulePtrL(const TCFSubModuleAddress &)
voidUnbindAllModuleL(TRequestStatus &, const TCFModuleNameF &, const TBool, CJob *&)
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()
Public Member Enumerations
enumTBMBindState {
EBindInProgress, EBindError, EBound, EUnbindInProgress, EUnbindError, EUnbound
}
Public Member Type Definitions
typedef RArray< TBindingInfo > RBindingInfoArray
Private Attributes
TDblQue< CBindInfo >iBindList
TInt iEnumBindingsIdx
TDblQue< CJob >iJobList
TDblQue< CModule >iModuleList
CPersistentSubModuleAddressCon *iModuleNameStor
MRootServerNotify *iNotify
TransactionId iTransactionId

Constructor & Destructor Documentation

CBindManager()

CBindManager()[private]

CBindManager constructor

~CBindManager()

~CBindManager()[virtual]

Destructor of CBindManager object.

Member Functions Documentation

BindSubmodulesL(TRequestStatus &, const TRSBindType, const TCFSubModuleAddress &, const TCFSubModuleAddress &, TInt, TInt)

voidBindSubmodulesL(TRequestStatus &aStatus,
const TRSBindTypeaType,
const TCFSubModuleAddress &aUpperSubmodule,
const TCFSubModuleAddress &aLowerSubmodule,
TIntaForwardQLength,
TIntaReverseQLength
)
Called by rootserver to bind two submodules. If the request is valid the bindmanager will send a Bind message to the module associated with each submodule (which may be the same for both) and will complete the request when a valid response is received from both, or timeout occurs. If a cancelled bind request exists for the same modules and type, then it is reactivated with the new aStatus.
leave
KErrNoMemory
leave
ERSModuleUnknown
leave
ERSSubModuleUnknown
leave
ERSModuleNotReady
leave
ERSAlreadyBound
leave
ERSBindingInProgress

Parameters

TRequestStatus & aStatusstatus which will be completed when finished
const TRSBindType aTypetype of binding defined by rootserver
const TCFSubModuleAddress & aUpperSubmodulefirst submodule to bind - the upper module in hierarchical bindings
const TCFSubModuleAddress & aLowerSubmodulesecond submodule to bind
TInt aForwardQLengthxxx
TInt aReverseQLengthxx

Cancel(TRequestStatus &)

TInt Cancel(TRequestStatus &aStatus)

Called by rootserver to cancel the request with the specified TRequestStatus. The bindmanager will continue to process responses from the modules and update the internal state information accordingly.

Parameters

TRequestStatus & aStatusstatus to be cancelled

ConstructL()

voidConstructL()[private]

ConvertRSBindType(const TRSBindType, TCFBindType &, TCFBindType &)

voidConvertRSBindType(const TRSBindTypeaType,
TCFBindType &aUpperBindType,
TCFBindType &aLowerBindType
)[private, static]

Convert a rootserver style binding type to the equivalent comms framework type

Parameters

const TRSBindType aTypea RootServer binding type
TCFBindType & aUpperBindTypecomms framework bind type for upper submodule
TCFBindType & aLowerBindTypecomms framework bind type for lower submodule

CreateModuleL(TRequestStatus &, const TCFModuleNameF &, const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)

voidCreateModuleL(TRequestStatus &aStatus,
const TCFModuleNameF &aModule,
const RCFChannel::TMsgQueues &aInputQueues,
const RCFChannel::TMsgQueues &aOutputQueues
)
Called by rootserver to inform the bindmanager of a new module and the queues to be used for communicating with it. The bindmanager will send a Discovery message to the module and will not complete the request until a valid DiscoveryResp is received or timeout occurs.
leave
KErrNoMemory
leave
ERSModuleAlreadyExist

Parameters

TRequestStatus & aStatusstatus which will be completed when finished
const TCFModuleNameF & aModulename of module to create
const RCFChannel::TMsgQueues & aInputQueuesqueues on which messages should sent to the module
const RCFChannel::TMsgQueues & aOutputQueuesqueues on which messages will be received from the module

EnumerateBindings(const TCFSubModuleAddress &, TBool, TBindingInfo &)

TInt EnumerateBindings(const TCFSubModuleAddress &aSubModule,
TBoolaRestart,
TBindingInfo &aInfo
)

Enumerates bindings by returning one at a time until there is no more.

Parameters

const TCFSubModuleAddress & aSubModulesubmodule or module to count bindings for
TBool aRestartwhether to start from the beginning
TBindingInfo & aInforeference to a binding info

EnumerateSubModules(const TCFModuleNameF &, TInt, TCFSubModuleNameF &)

TInt EnumerateSubModules(const TCFModuleNameF &aModuleName,
TIntaPosition,
TCFSubModuleNameF &aName
)

Return a list of sub modules, starting at the point specified by aFrom

Parameters

const TCFModuleNameF & aModuleNameThe module to enumerate submodules from
TInt aPositionStart writing submodules names from here
TCFSubModuleNameF & aNameThe descriptor to write to

FindBindInfo(const TCFSubModuleAddress &, const TCFSubModuleAddress &)

CBindInfo *FindBindInfo(const TCFSubModuleAddress &aUpperSubmodule,
const TCFSubModuleAddress &aLowerSubmodule
)[private]

If a bind exists between the two specified modules, then return a pointer to it.

Parameters

const TCFSubModuleAddress & aUpperSubmodulethe upper module in the bindinfo
const TCFSubModuleAddress & aLowerSubmodulethe lower module in the bindinfo

GetModulePtrL(const TCFModuleNameF &)

CModule *GetModulePtrL(const TCFModuleNameF &aModule)[private]
Search method to find a cmodule ptr from a module name
leave
ERSModuleUnknown

Parameters

const TCFModuleNameF & aModulename of module to find

GetModulePtrL(const TCFSubModuleAddress &)

CModule *GetModulePtrL(const TCFSubModuleAddress &aSubModuleAddr)[private]
Search method to find a cmodule ptr from a submodule address
leave
ERSModuleUnknown
leave
ERSSubModuleUnknown

Parameters

const TCFSubModuleAddress & aSubModuleAddrfull name of sub module to find

JobTimedOut(const TCFModuleNameF &, const TUint)

voidJobTimedOut(const TCFModuleNameF &aModuleName,
const TUintaTaskId
)[virtual]

Called by a cjob for each taskid when it times out. It informs the associated module.

Parameters

const TCFModuleNameF & aModuleNamethe name of the module associated with the task
const TUint aTaskIdthe id of the task

ModuleEndedL(const TCFModuleNameF &)

voidModuleEndedL(const TCFModuleNameF &aModule)
Called by rootserver to indicate that a module thread has exited and therefore any information stored about it should be deleted.
leave
KErrNoMemory
leave
ERSModuleUnknown
leave
ERSBindingExists indicates that a binding still exists for the module and should be removed by calling UnbindAlreadyDeadL to avoid an inconsistent state in module to which it is bound

Parameters

const TCFModuleNameF & aModulemodule to end

NewL(MRootServerNotify &)

CBindManager *NewL(MRootServerNotify &aRootServerNotifier)[static]
Creates new CBindManager object.
leave
KErrNoMemory

Parameters

MRootServerNotify & aRootServerNotifierCallback object when an unknown message is received

NumSubModules(const TCFModuleNameF &, TInt &)

TInt NumSubModules(const TCFModuleNameF &aName,
TInt &aNumSubs
)

Return the number of submodules which exist for the specified module

Parameters

const TCFModuleNameF & aNamemodule to count submodules for
TInt & aNumSubsnumber of submodules for module

ReceivedMessage(const TCFModuleNameF &, const TCFMessage &)

voidReceivedMessage(const TCFModuleNameF &aModule,
const TCFMessage &aNewMsg
)[virtual]

Called by a cmodule when a message with no associated task is received. The bindmanager passes the message to the rootserver.

Parameters

const TCFModuleNameF & aModulethe name of the module which received the message
const TCFMessage & aNewMsgthe received message

SendL(const TCFModuleNameF &, const RMessage2 &)

voidSendL(const TCFModuleNameF &aModule,
const RMessage2 &aMessage
)

Parameters

const TCFModuleNameF & aModule
const RMessage2 & aMessage

TaskCompleted(CModule &, const CTask &, TInt)

voidTaskCompleted(CModule &aModule,
const CTask &aTask,
TIntaStatus
)[virtual]

Called by a cmodule when a task is completed. Bindmanager passes the information to all jobs and bindinfos

Parameters

CModule & aModulethe cmodule which owns the completed task
const CTask & aTaskthe task which has finished
TInt aStatusthe status returned by the completed task

UnbindAllAndShutDownL(TRequestStatus &, const TCFModuleNameF &, TCFShutdownType)

voidUnbindAllAndShutDownL(TRequestStatus &aStatus,
const TCFModuleNameF &aModule,
TCFShutdownTypeaType
)
Called by rootserver to unbind all submodules from a specific module and then send a shutdown message. The bindmanager will send a pair of Unbind messages for each existing binding followed by a shutdown only to the module specified. The request will complete when a valid response is received for each message or timeout occurs.
leave
KErrNoMemory
leave
ERSModuleUnknown
leave
ERSModuleNotReady
leave
ERSBindingInProgress

Parameters

TRequestStatus & aStatusstatus which will be completed when finished
const TCFModuleNameF & aModulemodule to unbind and shut down
TCFShutdownType aTypexx

UnbindAllModuleL(TRequestStatus &, const TCFModuleNameF &, const TBool, CJob *&)

voidUnbindAllModuleL(TRequestStatus &aStatus,
const TCFModuleNameF &aModule,
const TBoolaModuleIsDead,
CJob *&pJob
)[private]
Send Unbind requests for every binding involving the specified module. If the ModuleIsDead parameter is true then no messages will be sent to the named target module.
leave
KErrNoMemory
leave
ERSModuleUnknown
leave
ERSSubModuleUnknown
leave
ERSBindingInProgress

Parameters

TRequestStatus & aStatusstatus which will be completed when finished
const TCFModuleNameF & aModulename of module to unbind
const TBool aModuleIsDeadindicates whether the target module is dead, and therefore should not be sent any messages
CJob *& pJobvar parameter which will be set to point to a new job if one is created

UnbindAlreadyDeadL(TRequestStatus &, const TCFModuleNameF &)

voidUnbindAlreadyDeadL(TRequestStatus &aStatus,
const TCFModuleNameF &aModule
)
Called by rootserver to unbind all submodules from a specific module where the module is known to be dead. The bindmanager will send Unbind unbind messages for each existing binding, except when the destination is the dead module. The request will complete when a valid response is received for each message or timeout occurs.
leave
KErrNoMemory
leave
ERSModuleUnknown
leave
ERSBindingInProgress

Parameters

TRequestStatus & aStatusstatus which will be completed when finished
const TCFModuleNameF & aModuledead module to unbind

UnbindSubmodulesL(TRequestStatus &, const TCFSubModuleAddress &, const TCFSubModuleAddress &)

voidUnbindSubmodulesL(TRequestStatus &aStatus,
const TCFSubModuleAddress &aUpperSubmodule,
const TCFSubModuleAddress &aLowerSubmodule
)
Called by rootserver to unbind two submodules. If the request is valid the bindmanager will send an Unbind message to the module associated with each submodule (which may be the same for both) and will complete the request when a valid response is received from both, or timeout occurs.
leave
KErrNoMemory
leave
ERSBindingUnknown
leave
ERSModuleUnknown
leave
ERSSubModuleUnknown
leave
ERSBindingInProgress

Parameters

TRequestStatus & aStatusstatus which will be completed when finished
const TCFSubModuleAddress & aUpperSubmodulefirst submodule to unbind
const TCFSubModuleAddress & aLowerSubmodulesecond submodule to unbind

Member Enumerations Documentation

Enum TBMBindState

Main singleton class providing Bind Manager functionality to the rootserver. This class handles bind and unbind messaging through comms framework queues and interfaces with the RootServer using asynch TReqestStatus objects.

Enumerators

EBindInProgress
EBindError
EBound
EUnbindInProgress
EUnbindError
EUnbound

Member Type Definitions Documentation

Typedef RBindingInfoArray

typedef RArray< TBindingInfo >RBindingInfoArray

Member Data Documentation

TDblQue< CBindInfo > iBindList

TDblQue< CBindInfo >iBindList[private]

TInt iEnumBindingsIdx

TInt iEnumBindingsIdx[private]

Index for enumeration of bindings

TDblQue< CJob > iJobList

TDblQue< CJob >iJobList[private]

TDblQue< CModule > iModuleList

TDblQue< CModule >iModuleList[private]

CPersistentSubModuleAddressCon * iModuleNameStor

CPersistentSubModuleAddressCon *iModuleNameStor[private]

MRootServerNotify * iNotify

MRootServerNotify *iNotify[private]

TransactionId iTransactionId

TransactionId iTransactionId[private]