Package muntjac :: Package service :: Module application_context :: Class IApplicationContext
[hide private]
[frames] | no frames]

Class IApplicationContext

source code

object --+
         |
        IApplicationContext
Known Subclasses:

IApplicationContext provides information about the running context of the application. Each context is shared by all applications that are open for one user. In a web-environment this corresponds to a HttpSession.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
getBaseDirectory(self)
Returns application context base directory.
source code
 
getApplications(self)
Returns a collection of all the applications in this context.
source code
 
addTransactionListener(self, listener)
Adds a transaction listener to this context.
source code
 
removeTransactionListener(self, listener)
Removes a transaction listener from this context.
source code
 
generateApplicationResourceURL(self, resource, urlKey)
Generate a URL that can be used as the relative location of e.g.
source code
 
isApplicationResourceURL(self, context, relativeUri)
Tests if a URL is for an application resource (APP/...).
source code
 
getURLKey(self, context, relativeUri)
Gets the identifier (key) from an application resource URL.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

getBaseDirectory(self)

source code 

Returns application context base directory.

Typically an application is deployed in a such way that is has an application directory. For web applications this directory is the root directory of the web applications. In some cases applications might not have an application directory.

Returns:
The application base directory or None if the application has no base directory.

getApplications(self)

source code 

Returns a collection of all the applications in this context.

Each application context contains all active applications for one user.

Returns:
A collection containing all the applications in this context.

addTransactionListener(self, listener)

source code 

Adds a transaction listener to this context. The transaction listener is called before and after each each request related to this session except when serving static resources.

The transaction listener must not be None.

removeTransactionListener(self, listener)

source code 

Removes a transaction listener from this context.

Parameters:
  • listener - the listener to be removed.

See Also: ITransactionListener

generateApplicationResourceURL(self, resource, urlKey)

source code 

Generate a URL that can be used as the relative location of e.g. an ApplicationResource.

This method should only be called from the processing of a UIDL request, not from a background thread. The return value is null if used outside a suitable request.

Parameters:
  • resource
  • urlKey - a key for the resource that can later be extracted from a URL with getURLKey

Deprecated: this method is intended for terminal implementation only and is subject to change/removal from the interface (to AbstractCommunicationManager)

isApplicationResourceURL(self, context, relativeUri)

source code 

Tests if a URL is for an application resource (APP/...).

Deprecated: this method is intended for terminal implementation only and is subject to change/removal from the interface (to AbstractCommunicationManager)

getURLKey(self, context, relativeUri)

source code 

Gets the identifier (key) from an application resource URL. This key is the one that was given to generateApplicationResourceURL when creating the URL.

Deprecated: this method is intended for terminal implementation only and is subject to change/removal from the interface (to AbstractCommunicationManager)