CBindManager Class Reference

class CBindManager : public CBase

Inherits from

Nested Classes and Structures

Public Member Functions
~CBindManager ()
void BindSubmodulesL ( TRequestStatus &, const TRSBindType , const TCFSubModuleAddress &, const TCFSubModuleAddress &, TInt , TInt )
TInt Cancel ( TRequestStatus &)
void CreateModuleL ( TRequestStatus &, const TCFModuleNameF &, const RCFChannel::TMsgQueues &, const RCFChannel::TMsgQueues &)
TInt EnumerateBindings (const TCFSubModuleAddress &, TBool , TBindingInfo &)
TInt EnumerateSubModules (const TCFModuleNameF &, TInt , TCFSubModuleNameF &)
void JobTimedOut (const TCFModuleNameF &, const TUint )
void ModuleEndedL (const TCFModuleNameF &)
CBindManager * NewL ( MRootServerNotify &)
TInt NumSubModules (const TCFModuleNameF &, TInt &)
void ReceivedMessage (const TCFModuleNameF &, const TCFMessage &)
void SendL (const TCFModuleNameF &, const RMessage2 &)
void TaskCompleted ( CModule &, const CTask &, TInt )
void UnbindAllAndShutDownL ( TRequestStatus &, const TCFModuleNameF &, TCFShutdownType )
void UnbindAlreadyDeadL ( TRequestStatus &, const TCFModuleNameF &)
void UnbindSubmodulesL ( TRequestStatus &, const TCFSubModuleAddress &, const TCFSubModuleAddress &)
Private Member Functions
CBindManager ()
void ConstructL ()
void ConvertRSBindType (const TRSBindType , TCFBindType &, TCFBindType &)
CBindInfo * FindBindInfo (const TCFSubModuleAddress &, const TCFSubModuleAddress &)
CModule * GetModulePtrL (const TCFModuleNameF &)
CModule * GetModulePtrL (const TCFSubModuleAddress &)
void UnbindAllModuleL ( 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
enum TBMBindState {
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)

void BindSubmodulesL ( TRequestStatus & aStatus,
const TRSBindType aType,
const TCFSubModuleAddress & aUpperSubmodule,
const TCFSubModuleAddress & aLowerSubmodule,
TInt aForwardQLength,
TInt aReverseQLength
)
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 & aStatus status which will be completed when finished
const TRSBindType aType type of binding defined by rootserver
const TCFSubModuleAddress & aUpperSubmodule first submodule to bind - the upper module in hierarchical bindings
const TCFSubModuleAddress & aLowerSubmodule second submodule to bind
TInt aForwardQLength xxx
TInt aReverseQLength xx

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 & aStatus status to be cancelled

ConstructL()

void ConstructL ( ) [private]

ConvertRSBindType(const TRSBindType, TCFBindType &, TCFBindType &)

void ConvertRSBindType ( const TRSBindType aType,
TCFBindType & aUpperBindType,
TCFBindType & aLowerBindType
) [private, static]

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

Parameters

const TRSBindType aType a RootServer binding type
TCFBindType & aUpperBindType comms framework bind type for upper submodule
TCFBindType & aLowerBindType comms framework bind type for lower submodule

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

void CreateModuleL ( 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 & aStatus status which will be completed when finished
const TCFModuleNameF & aModule name of module to create
const RCFChannel::TMsgQueues & aInputQueues queues on which messages should sent to the module
const RCFChannel::TMsgQueues & aOutputQueues queues on which messages will be received from the module

EnumerateBindings(const TCFSubModuleAddress &, TBool, TBindingInfo &)

TInt EnumerateBindings ( const TCFSubModuleAddress & aSubModule,
TBool aRestart,
TBindingInfo & aInfo
)

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

Parameters

const TCFSubModuleAddress & aSubModule submodule or module to count bindings for
TBool aRestart whether to start from the beginning
TBindingInfo & aInfo reference to a binding info

EnumerateSubModules(const TCFModuleNameF &, TInt, TCFSubModuleNameF &)

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

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

Parameters

const TCFModuleNameF & aModuleName The module to enumerate submodules from
TInt aPosition Start writing submodules names from here
TCFSubModuleNameF & aName The 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 & aUpperSubmodule the upper module in the bindinfo
const TCFSubModuleAddress & aLowerSubmodule the 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 & aModule name 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 & aSubModuleAddr full name of sub module to find

JobTimedOut(const TCFModuleNameF &, const TUint)

void JobTimedOut ( const TCFModuleNameF & aModuleName,
const TUint aTaskId
) [virtual]

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

Parameters

const TCFModuleNameF & aModuleName the name of the module associated with the task
const TUint aTaskId the id of the task

ModuleEndedL(const TCFModuleNameF &)

void ModuleEndedL ( 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 & aModule module to end

NewL(MRootServerNotify &)

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

Parameters

MRootServerNotify & aRootServerNotifier Callback 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 & aName module to count submodules for
TInt & aNumSubs number of submodules for module

ReceivedMessage(const TCFModuleNameF &, const TCFMessage &)

void ReceivedMessage ( 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 & aModule the name of the module which received the message
const TCFMessage & aNewMsg the received message

SendL(const TCFModuleNameF &, const RMessage2 &)

void SendL ( const TCFModuleNameF & aModule,
const RMessage2 & aMessage
)

Parameters

const TCFModuleNameF & aModule
const RMessage2 & aMessage

TaskCompleted(CModule &, const CTask &, TInt)

void TaskCompleted ( CModule & aModule,
const CTask & aTask,
TInt aStatus
) [virtual]

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

Parameters

CModule & aModule the cmodule which owns the completed task
const CTask & aTask the task which has finished
TInt aStatus the status returned by the completed task

UnbindAllAndShutDownL(TRequestStatus &, const TCFModuleNameF &, TCFShutdownType)

void UnbindAllAndShutDownL ( TRequestStatus & aStatus,
const TCFModuleNameF & aModule,
TCFShutdownType aType
)
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 & aStatus status which will be completed when finished
const TCFModuleNameF & aModule module to unbind and shut down
TCFShutdownType aType xx

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

void UnbindAllModuleL ( TRequestStatus & aStatus,
const TCFModuleNameF & aModule,
const TBool aModuleIsDead,
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 & aStatus status which will be completed when finished
const TCFModuleNameF & aModule name of module to unbind
const TBool aModuleIsDead indicates whether the target module is dead, and therefore should not be sent any messages
CJob *& pJob var parameter which will be set to point to a new job if one is created

UnbindAlreadyDeadL(TRequestStatus &, const TCFModuleNameF &)

void UnbindAlreadyDeadL ( 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 & aStatus status which will be completed when finished
const TCFModuleNameF & aModule dead module to unbind

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

void UnbindSubmodulesL ( 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 & aStatus status which will be completed when finished
const TCFSubModuleAddress & aUpperSubmodule first submodule to unbind
const TCFSubModuleAddress & aLowerSubmodule second 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]