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 ()
void AddSession ()
TInt BufferSizeMultiplier ()
void DispatchMessage ( CSensrvMessage &)
TInt DuplicateMutexHandle (const RMutex &, RMutex &)
TBool EcomChanged ( RImplInfoPtrArray *)
TInt GenerateUniqueId ()
TBool LoadDynamicChannelSsysIfNeeded (const TSensrvResourceChannelInfo &, const RMessage2 &, TBool )
CSensrvProxyManager * NewL ( CSensrvServer &)
void NotifyChannelChange (const TSensrvResourceChannelInfo &, TSensrvChannelChangeType )
void NotifyProxyInitialized ()
void RemoveChannelChangeListenerFromDynamicChannelSsys (const TSensrvResourceChannelInfo &, const RMessage2 &)
RHeap * ServerHeap ()
void SessionTerminated ( CSensrvSession *)
void ShutdownServer (const RMessage2 &)
void ShutdownServer ()
TInt SsyHeapMaxSize ()
TTimeIntervalMicroSeconds32 & SsyInactivityPeriod ()
TInt SsyStackSize ()
void SsyThreadTerminated ()
TTimeIntervalMicroSeconds32 & TerminationPeriod ()
TTimeIntervalMicroSeconds32 & ThreadTerminationGracePeriod ()
TTimeIntervalMicroSeconds32 & TransactionTimeout ()
Private Member Functions
CSensrvProxyManager ( CSensrvServer &)
CSensrvPluginProxy * AddProxy (const TUid &)
void ConstructL ()
CSensrvPluginProxy * GetProxyForChannel ( TSensrvChannelId )
void GetSettings ()
void HandleTransactionsOpenChannel ()
void HandleTransactionsQueryChannels ()
void OpenChannel ( CSensrvMessage &)
TInt ProxyCleanerCallback ( TAny *)
void QueryChannels ( 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 & aProxyUid Implementation UID of the proxy to add

AddSession()

void AddSession ( )

BufferSizeMultiplier()

TInt BufferSizeMultiplier ( ) [inline]

Get channel data buffer size multiplier.

Since
S60 5.0

ConstructL()

void ConstructL ( ) [private]

Second phase of construction.

DispatchMessage(CSensrvMessage &)

void DispatchMessage ( CSensrvMessage & aMessage )

Handles client message. Message completion responsibility transfers.

Since
S60 5.0

Parameters

CSensrvMessage & aMessage The 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 & aSrc Source handle
RMutex & aDst Destination handle

EcomChanged(RImplInfoPtrArray *)

TBool EcomChanged ( RImplInfoPtrArray * aImplementationInfos ) [virtual]

Called when the ecom has been scanned

Since
S60 5.0

Parameters

RImplInfoPtrArray * aImplementationInfos Found 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 ( TSensrvChannelId aChannelId ) const [private]

Gets the proxy that handles the specified channel.

Since
S60 5.0

Parameters

TSensrvChannelId aChannelId The channel id of desired channel.

GetSettings()

void GetSettings ( ) [private]

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

Since
S60 5.0

HandleTransactionsOpenChannel()

void HandleTransactionsOpenChannel ( ) [private]

HandleTransactionsQueryChannels()

void HandleTransactionsQueryChannels ( ) [private]

Handles waiting transactions.

Since
S60 5.0

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

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

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

Since
S60 5.0

Parameters

const TSensrvResourceChannelInfo & aQueryInfo Channel query info
const RMessage2 & aQueryMessage
TBool aAddChannelChangeListener Updates 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)

void NotifyChannelChange ( const TSensrvResourceChannelInfo & aChangedChannel,
TSensrvChannelChangeType aChangeType
)

Notifies clients that a change has happened in available channels.

Since
S60 5.0

Parameters

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

NotifyProxyInitialized()

void NotifyProxyInitialized ( )

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 &)

void OpenChannel ( 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 * aObject Pointer to this

QueryChannels(CSensrvMessage &)

void QueryChannels ( CSensrvMessage & aMessage ) [private]

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

Since
S60 5.0

Parameters

CSensrvMessage & aMessage The message related to this request. Ownership passed here.

RemoveChannelChangeListenerFromDynamicChannelSsys(const TSensrvResourceChannelInfo &, const RMessage2 &)

void RemoveChannelChangeListenerFromDynamicChannelSsys ( 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 & aQueryInfo Channel query info
const RMessage2 & aQueryMessage

ServerHeap()

RHeap * ServerHeap ( ) [inline]

Get pointer to server main thread heap

Since
S60 5.0

SessionTerminated(CSensrvSession *)

void SessionTerminated ( CSensrvSession * aSession )

Cleans up session related data.

Since
S60 5.0

Parameters

CSensrvSession * aSession The session that was deleted

ShutdownServer(const RMessage2 &)

void ShutdownServer ( const RMessage2 & aMessage )

Shuts server down gracefully.

Since
S60 5.0

Parameters

const RMessage2 & aMessage Message related to shutdown.

ShutdownServer()

void ShutdownServer ( )

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()

void SsyThreadTerminated ( )

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.