QwuiResourceProviderServer Class Reference

this class holds currently alive sessions and creates new ones on demand. This class is used to hold sessions and manage their lifetimes. A new session can be created with newSession(). With takeSession() and releaseSession() you can take the ownership of a session for your specific handling and release it once you are finished. More...

#include <qwuiresourceproviderserver.h>

Inheritance diagram for QwuiResourceProviderServer:
QwuiApplicationServer

List of all members.

Public Member Functions

 QwuiResourceProviderServer (QObject *parent=NULL)
virtual ~QwuiResourceProviderServer ()
void setResourceProviderFactory (QwuiAbstractResourceProviderFactory *factory)
QwuiAbstractResourceProviderFactoryresourceProviderFactory () const
void setHttpServer (QwuiAbstractHttpServer *server)
QwuiAbstractHttpServerhttpServer () const
void setDefaultSessionLifeTime (int secs)
int defaultSessionLifeTime () const
virtual
QwuiAbstractResourceProvider
takeSession (const QString &sessionId)
virtual void releaseSession (QwuiAbstractResourceProvider *session)
virtual
QwuiAbstractResourceProvider
newSession ()
virtual bool start ()

Protected Member Functions

virtual void customEvent (QEvent *event)

Private Slots

void cleanupSessions ()

Private Member Functions

void pullToCurrentThread (QObject *obj)

Private Attributes

QHash< QString,
QwuiAbstractResourceProvider * > 
m_sessions
QwuiAbstractResourceProviderFactorym_factory
QwuiAbstractHttpServerm_server
QTimer * m_sessionCleanupTimer
QReadWriteLock * m_lock
int m_defaultSessionLifeTime

Detailed Description

this class holds currently alive sessions and creates new ones on demand. This class is used to hold sessions and manage their lifetimes. A new session can be created with newSession(). With takeSession() and releaseSession() you can take the ownership of a session for your specific handling and release it once you are finished.


Constructor & Destructor Documentation

QwuiResourceProviderServer::QwuiResourceProviderServer ( QObject *  parent = NULL  ) 
QwuiResourceProviderServer::~QwuiResourceProviderServer (  )  [virtual]

Member Function Documentation

void QwuiResourceProviderServer::cleanupSessions (  )  [private, slot]
void QwuiResourceProviderServer::customEvent ( QEvent *  event  )  [protected, virtual]
int QwuiResourceProviderServer::defaultSessionLifeTime (  )  const

The default session lifetime is 30 min.

Returns:
the session lifetime in seconds.
QwuiAbstractHttpServer * QwuiResourceProviderServer::httpServer (  )  const
Returns:
the HTTP server
QwuiAbstractResourceProvider * QwuiResourceProviderServer::newSession (  )  [virtual]
void QwuiResourceProviderServer::pullToCurrentThread ( QObject *  obj  )  [private]
void QwuiResourceProviderServer::releaseSession ( QwuiAbstractResourceProvider session  )  [virtual]
QwuiAbstractResourceProviderFactory * QwuiResourceProviderServer::resourceProviderFactory (  )  const
Returns:
the main resource provider factory.
void QwuiResourceProviderServer::setDefaultSessionLifeTime ( int  secs  ) 
Parameters:
secs the session lifetime in seconds.
void QwuiResourceProviderServer::setHttpServer ( QwuiAbstractHttpServer server  ) 
Parameters:
server the HTTP server
void QwuiResourceProviderServer::setResourceProviderFactory ( QwuiAbstractResourceProviderFactory factory  ) 
Parameters:
factory the main resource provider factory.
bool QwuiResourceProviderServer::start (  )  [virtual]
QwuiAbstractResourceProvider * QwuiResourceProviderServer::takeSession ( const QString &  sessionId  )  [virtual]

Member Data Documentation

QReadWriteLock* QwuiResourceProviderServer::m_lock [private]

The documentation for this class was generated from the following files:
Generated on Fri Jun 4 01:18:58 2010 for QtWui : Web User Interfaces for Qt by  doxygen 1.6.3