CSensrvProxyManager Class Reference

class CSensrvProxyManager : public CBase

Manages proxies and transactions not targeting single channel.

Since
S60 5.0

Inherits from

Public Member Functions
~CSensrvProxyManager()
voidAddSession()
TInt BufferSizeMultiplier()
voidDispatchMessage(CSensrvMessage &)
TInt DuplicateMutexHandle(const RMutex &, RMutex &)
TBool EcomChanged(RImplInfoPtrArray *)
TInt GenerateUniqueId()
TBool LoadDynamicChannelSsysIfNeeded(const TSensrvResourceChannelInfo &, const RMessage2 &, TBool)
CSensrvProxyManager *NewL(CSensrvServer &)
voidNotifyChannelChange(const TSensrvResourceChannelInfo &, TSensrvChannelChangeType)
voidNotifyProxyInitialized()
voidRemoveChannelChangeListenerFromDynamicChannelSsys(const TSensrvResourceChannelInfo &, const RMessage2 &)
RHeap *ServerHeap()
voidSessionTerminated(CSensrvSession *)
voidShutdownServer(const RMessage2 &)
voidShutdownServer()
TInt SsyHeapMaxSize()
TTimeIntervalMicroSeconds32 &SsyInactivityPeriod()
TInt SsyStackSize()
voidSsyThreadTerminated()
TTimeIntervalMicroSeconds32 &TerminationPeriod()
TTimeIntervalMicroSeconds32 &ThreadTerminationGracePeriod()
TTimeIntervalMicroSeconds32 &TransactionTimeout()
Private Member Functions
CSensrvProxyManager(CSensrvServer &)
CSensrvPluginProxy *AddProxy(const TUid &)
voidConstructL()
CSensrvPluginProxy *GetProxyForChannel(TSensrvChannelId)
voidGetSettings()
voidHandleTransactionsOpenChannel()
voidHandleTransactionsQueryChannels()
voidOpenChannel(CSensrvMessage &)
TInt ProxyCleanerCallback(TAny *)
voidQueryChannels(CSensrvMessage &)
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()
Private Attributes
TBool iAllProxiesInitialized
TInt iBufferSizeMultiplier
CSensrvEcomChangeListener *iEcomChangeListener
RHeap *iHeap
TInt iIdCounter
CPeriodic *iProxyCleaner
RPointerArray< CSensrvPluginProxy >iProxyList
RMutex iProxyManagerMutex
CSensrvServer &iServer
CSensrvShutdown *iServerShutdown
RThread iServerThread
TInt iSessionCounter
TBool iShutdown
RMessagePtr2 iShutdownMessage
TInt iShuttingDownCount
TInt iSsyHeapMaxSize
RImplInfoPtrArray *iSsyImplInfoArray
TTimeIntervalMicroSeconds32 iSsyInactivityPeriod
TInt iSsyStackSize
TTimeIntervalMicroSeconds32 iTerminationPeriod
TTimeIntervalMicroSeconds32 iThreadTerminationGracePeriod
TTimeIntervalMicroSeconds32 iTransactionTimeout
CSensrvTransactionQueue *iWaitQueueOpenChannel
CSensrvTransactionQueue *iWaitQueueQueryChannels

Constructor & Destructor Documentation

CSensrvProxyManager(CSensrvServer &)

CSensrvProxyManager(CSensrvServer &aServer)[private]

C++ constructor

Parameters

CSensrvServer & aServer

~CSensrvProxyManager()

~CSensrvProxyManager()[virtual]

Destructor.

Member Functions Documentation

AddProxy(const TUid &)

CSensrvPluginProxy *AddProxy(const TUid &aProxyUid)[private]

Adds proxy to proxy list

Since
S60 5.0

Parameters

const TUid & aProxyUidImplementation UID of the proxy to add

AddSession()

voidAddSession()

BufferSizeMultiplier()

TInt BufferSizeMultiplier()[inline]

Get channel data buffer size multiplier.

Since
S60 5.0

ConstructL()

voidConstructL()[private]

Second phase of construction.

DispatchMessage(CSensrvMessage &)

voidDispatchMessage(CSensrvMessage &aMessage)

Handles client message. Message completion responsibility transfers.

Since
S60 5.0

Parameters

CSensrvMessage & aMessageThe message containing the client request

DuplicateMutexHandle(const RMutex &, RMutex &)

TInt DuplicateMutexHandle(const RMutex &aSrc,
RMutex &aDst
)const

Duplicates mutex handle to one held by main thread.

Since
S60 5.0

Parameters

const RMutex & aSrcSource handle
RMutex & aDstDestination handle

EcomChanged(RImplInfoPtrArray *)

TBool EcomChanged(RImplInfoPtrArray *aImplementationInfos)[virtual]

Called when the ecom has been scanned

Since
S60 5.0

Parameters

RImplInfoPtrArray * aImplementationInfosFound SSY implementation infos The observer is responsible for cleanup of this array, if change was not blocked (return ETrue).

GenerateUniqueId()

TInt GenerateUniqueId()

Generates new unique id (within context of this server instance).

Since
S60 5.0

GetProxyForChannel(TSensrvChannelId)

CSensrvPluginProxy *GetProxyForChannel(TSensrvChannelIdaChannelId)const [private]

Gets the proxy that handles the specified channel.

Since
S60 5.0

Parameters

TSensrvChannelId aChannelIdThe channel id of desired channel.

GetSettings()

voidGetSettings()[private]

Fetches configurable settings from cenrep and stores them in member variables.

Since
S60 5.0

HandleTransactionsOpenChannel()

voidHandleTransactionsOpenChannel()[private]

HandleTransactionsQueryChannels()

voidHandleTransactionsQueryChannels()[private]

Handles waiting transactions.

Since
S60 5.0

LoadDynamicChannelSsysIfNeeded(const TSensrvResourceChannelInfo &, const RMessage2 &, TBool)

TBool LoadDynamicChannelSsysIfNeeded(const TSensrvResourceChannelInfo &aQueryInfo,
const RMessage2 &aQueryMessage,
TBoolaAddChannelChangeListener
)

Loads the dynamic channel SSYs that matches to given query if not already loaded.

Since
S60 5.0

Parameters

const TSensrvResourceChannelInfo & aQueryInfoChannel query info
const RMessage2 & aQueryMessage
TBool aAddChannelChangeListenerUpdates the listener reference count if ETrue

NewL(CSensrvServer &)

CSensrvProxyManager *NewL(CSensrvServer &aServer)[static]

Two phase constructor

Since
S60 5.0
Exceptions
KErrNoMemory

Out of memory

Parameters

CSensrvServer & aServer

NotifyChannelChange(const TSensrvResourceChannelInfo &, TSensrvChannelChangeType)

voidNotifyChannelChange(const TSensrvResourceChannelInfo &aChangedChannel,
TSensrvChannelChangeTypeaChangeType
)

Notifies clients that a change has happened in available channels.

Since
S60 5.0

Parameters

const TSensrvResourceChannelInfo & aChangedChannelChannel information of the channel.
TSensrvChannelChangeType aChangeTypeIf ESensrvChannelAdded, channel is a newly available channel. If ESensrvChannelRemoved, channel was removed and is no longer available.

NotifyProxyInitialized()

voidNotifyProxyInitialized()

Notifies that a proxy has finished its initialization. This triggers wait queue handling.

Note that the notifying proxy might or might not have initialized properly.

Since
S60 5.0

OpenChannel(CSensrvMessage &)

voidOpenChannel(CSensrvMessage &aMessage)[private]

Parameters

CSensrvMessage & aMessage

ProxyCleanerCallback(TAny *)

TInt ProxyCleanerCallback(TAny *aObject)[private, static]

Callback method for proxy cleaner periodic object. Check which proxies are marked for deletion and deletes them if they are ready for cleanup.

Since
S60 5.0

Parameters

TAny * aObjectPointer to this

QueryChannels(CSensrvMessage &)

voidQueryChannels(CSensrvMessage &aMessage)[private]

Requests info about channels asynchronously. Any errors are indicated in message completion code.

Since
S60 5.0

Parameters

CSensrvMessage & aMessageThe message related to this request. Ownership passed here.

RemoveChannelChangeListenerFromDynamicChannelSsys(const TSensrvResourceChannelInfo &, const RMessage2 &)

voidRemoveChannelChangeListenerFromDynamicChannelSsys(const TSensrvResourceChannelInfo &aQueryInfo,
const RMessage2 &aQueryMessage
)

Removes channel change listener from the matching dynamic channel SSYs to allow unloading.

Since
S60 5.0

Parameters

const TSensrvResourceChannelInfo & aQueryInfoChannel query info
const RMessage2 & aQueryMessage

ServerHeap()

RHeap *ServerHeap()[inline]

Get pointer to server main thread heap

Since
S60 5.0

SessionTerminated(CSensrvSession *)

voidSessionTerminated(CSensrvSession *aSession)

Cleans up session related data.

Since
S60 5.0

Parameters

CSensrvSession * aSessionThe session that was deleted

ShutdownServer(const RMessage2 &)

voidShutdownServer(const RMessage2 &aMessage)

Shuts server down gracefully.

Since
S60 5.0

Parameters

const RMessage2 & aMessageMessage related to shutdown.

ShutdownServer()

voidShutdownServer()

SsyHeapMaxSize()

TInt SsyHeapMaxSize()[inline]

Get SSY heap max size

Since
S60 5.0

SsyInactivityPeriod()

TTimeIntervalMicroSeconds32 &SsyInactivityPeriod()[inline]

Get SSY inactivity period before unloading

Since
S60 5.0

SsyStackSize()

TInt SsyStackSize()[inline]

Get SSY stack size

Since
S60 5.0

SsyThreadTerminated()

voidSsyThreadTerminated()

Notifies that proxy thread has been terminated

Since
S60 5.0

TerminationPeriod()

TTimeIntervalMicroSeconds32 &TerminationPeriod()[inline]

ThreadTerminationGracePeriod()

TTimeIntervalMicroSeconds32 &ThreadTerminationGracePeriod()[inline]

Get thread termination grace period

Since
S60 5.0

TransactionTimeout()

TTimeIntervalMicroSeconds32 &TransactionTimeout()[inline]

Get transaction timeout

Since
S60 5.0

Member Data Documentation

TBool iAllProxiesInitialized

TBool iAllProxiesInitialized[private]

Indicates all proxies have been initialized

TInt iBufferSizeMultiplier

TInt iBufferSizeMultiplier[private]

Buffer size multiplier.

CSensrvEcomChangeListener * iEcomChangeListener

CSensrvEcomChangeListener *iEcomChangeListener[private]

Listener for SSY plugin changes Own

RHeap * iHeap

RHeap *iHeap[private]

Pointer to server main thread heap. Not own.

TInt iIdCounter

TInt iIdCounter[private]

Counter used to generate unique ids.

CPeriodic * iProxyCleaner

CPeriodic *iProxyCleaner[private]

Used to delete uninstalled proxies asynchronously Own

RPointerArray< CSensrvPluginProxy > iProxyList

RPointerArray< CSensrvPluginProxy >iProxyList[private]

Master list or proxies. Own proxies contained in array.

RMutex iProxyManagerMutex

RMutex iProxyManagerMutex[private]

Critical section to protect access to iIdCounter

CSensrvServer & iServer

CSensrvServer &iServer[private]

Reference to server main class. Not own

CSensrvShutdown * iServerShutdown

CSensrvShutdown *iServerShutdown[private]

A pointer to server shutdown, owned

RThread iServerThread

RThread iServerThread[private]

Server thread handle

TInt iSessionCounter

TInt iSessionCounter[private]

Keep track of current sessions

TBool iShutdown

TBool iShutdown[private]

Indicates if automatic server termination has been started.

RMessagePtr2 iShutdownMessage

RMessagePtr2 iShutdownMessage[private]

Shutting down message.

TInt iShuttingDownCount

TInt iShuttingDownCount[private]

Number of SSY threads still active during shutdown.

TInt iSsyHeapMaxSize

TInt iSsyHeapMaxSize[private]

SSY thread maximum heap size

RImplInfoPtrArray * iSsyImplInfoArray

RImplInfoPtrArray *iSsyImplInfoArray[private]

Implementation info array of SSYs Own.

TTimeIntervalMicroSeconds32 iSsyInactivityPeriod

TTimeIntervalMicroSeconds32 iSsyInactivityPeriod[private]

SSY inactivity period before unloading

TInt iSsyStackSize

TInt iSsyStackSize[private]

SSY thread stack size

TTimeIntervalMicroSeconds32 iTerminationPeriod

TTimeIntervalMicroSeconds32 iTerminationPeriod[private]

Automatic server termination grace period

TTimeIntervalMicroSeconds32 iThreadTerminationGracePeriod

TTimeIntervalMicroSeconds32 iThreadTerminationGracePeriod[private]

Thread termination grace period

TTimeIntervalMicroSeconds32 iTransactionTimeout

TTimeIntervalMicroSeconds32 iTransactionTimeout[private]

Transaction timeout for plugin transactions

CSensrvTransactionQueue * iWaitQueueOpenChannel

CSensrvTransactionQueue *iWaitQueueOpenChannel[private]

Holds transactions while all proxies finish initializing. Queued transactions are owned by queue. Own.

CSensrvTransactionQueue * iWaitQueueQueryChannels

CSensrvTransactionQueue *iWaitQueueQueryChannels[private]

Holds transactions while all proxies finish initializing. Queued transactions are owned by queue. Own.