Home · Modules · Classes · Namespaces · Functions

QxtAbstractWebSessionManager Class Reference
[QxtWeb module]

The QxtAbstractWebSessionManager class is a base class for QxtWeb session managers More...

    #include <QxtAbstractWebSessionManager>

Inherits QObject.

Inherited by QxtHttpSessionManager.

Public Functions

Protected Functions

Protected Slots

Additional Inherited Members


Detailed Description

The QxtAbstractWebSessionManager class is a base class for QxtWeb session managers

QxtAbstractWebSessionManager is the base class for all QxtWeb session managers.

Session managers are responsible for managing connections between web browsers and web services, for creating sessions and their corresponding service objects, and for managing and dispatching events between browsers and services.

Note that the session manager is not responsible for destroying service objects. A service object that wishes to end its corresponding session may destroy itself (see QObject::deleteLater()) and QxtAbstractWebSessionManager will automatically clean up its internal session tracking data.

See also QxtAbstractWebService.


Member Function Documentation

QxtAbstractWebSessionManager::QxtAbstractWebSessionManager ( QObject * parent = 0 )

Creates a QxtAbstractWebSessionManager with the specified parent.

Note that this is an abstract class and cannot be instantiated directly.

int QxtAbstractWebSessionManager::createService ()   [protected]

Creates a new session and returns its session ID.

This function uses the serviceFactory() to request an instance of the web service.

See also serviceFactory().

void QxtAbstractWebSessionManager::postEvent ( QxtWebEvent * event )   [pure virtual]

Adds the event to the event queue for its associated session.

Since different protocols may require different event processing behavior, there is no default implementation in QxtAbstractWebSessionManager. Subclasses are responsible for maintaining event queues and deciding when and where to dispatch events.

Depending on the subclass's implementation posted events may not be dispatched for some time, and is is possible that an event may never be dispatched if the session is terminated before the event is handled.

See also QxtWebEvent.

void QxtAbstractWebSessionManager::processEvents ()   [pure virtual protected slot]

Processes pending events for all sessions.

Since different protocols may require different event processing behavior, there is no default implementation in QxtAbstractWebSessionManager. Subclasses are responsible for maintaining event queues and deciding when and where to dispatch events.

processEvents() is not required to dispatch all events immediately. In particular, some events may require certain conditions to be met before they may be fully processed. (For example, because HTTP cookies are sent as response headers, QxtHttpServerConnector may not dispatch a QxtWebStoreCookieEvent until a QxtWebPageEvent for the same session is available.) Unprocessed events may remain in the event queue.

See also QxtWebEvent.

ServiceFactory * QxtAbstractWebSessionManager::serviceFactory () const

Returns the service factory in use by the session manager.

See also setServiceFactory(ServiceFactory*).

QxtAbstractWebService * QxtAbstractWebSessionManager::session ( int sessionID ) const

Returns the service object corresponding to the provided sessionID.

void QxtAbstractWebSessionManager::setServiceFactory ( ServiceFactory * factory )

Sets the service factory for the session manager.

The service factory is invoked every time the session manager creates a new session. Usually, an application providing web services will instantiate one QxtAbstractWebService object for each session. For services that do not require separate sessions, such as those that serve only static pages, the factory may return a pointer to the same object for multiple requests.

See also serviceFactory() and QxtAbstractWebSessionManager::ServiceFactory.

bool QxtAbstractWebSessionManager::start ()   [pure virtual]

Starts the session manager.

Session managers should not create sessions before start() is invoked. Subclasses are encouraged to refrain from accepting connections until the session manager is started.


Copyright © 2007-2011 Qxt Foundation
Qxt 0.6.2