com.vaadin.service.
Interface ApplicationContext
All Superinterfaces:
All Known Implementing Classes:
AbstractWebApplicationContext, PortletApplicationContext, PortletApplicationContext2, WebApplicationContext
- extends Serializable
public interface ApplicationContext
ApplicationContext
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.
Since:
3.1
Version:
6.8.18
Author:
Vaadin Ltd.
Nested Class Summary | |
---|---|
static interface |
ApplicationContext.TransactionListener
Interface for listening to transaction events. |
Method Summary | |
---|---|
void |
addTransactionListener(ApplicationContext.TransactionListener listener)
Adds a transaction listener to this context. |
String |
generateApplicationResourceURL(ApplicationResource resource,
String urlKey)
Deprecated. this method is intended for terminal implementation only and is subject to change/removal from the interface (to AbstractCommunicationManager ) |
Collection<Application> |
getApplications()
Returns a collection of all the applications in this context. |
File |
getBaseDirectory()
Returns application context base directory. |
String |
getURLKey(URL context,
String relativeUri)
Deprecated. this method is intended for terminal implementation only and is subject to change/removal from the interface (to AbstractCommunicationManager ) |
boolean |
isApplicationResourceURL(URL context,
String relativeUri)
Deprecated. this method is intended for terminal implementation only and is subject to change/removal from the interface (to AbstractCommunicationManager ) |
void |
removeTransactionListener(ApplicationContext.TransactionListener listener)
Removes a transaction listener from this context. |
Method Detail |
---|
getBaseDirectory
File getBaseDirectory()
- Returns:
- The application base directory or null if the application has no base directory.
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 (for example web applications running inside a war).
getApplications
Collection<Application> getApplications()
- Returns:
- A collection containing all the applications in this context.
Returns a collection of all the applications in this context. Each application context contains all active applications for one user.
addTransactionListener
void addTransactionListener(ApplicationContext.TransactionListener listener)
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 null.
removeTransactionListener
void removeTransactionListener(ApplicationContext.TransactionListener listener)
- Parameters:
listener
- the listener to be removed.- See Also:
ApplicationContext.TransactionListener
Removes a transaction listener from this context.
generateApplicationResourceURL
@Deprecated
String generateApplicationResourceURL(ApplicationResource resource,
String urlKey)
- Parameters:
resource
-urlKey
- a key for the resource that can later be extracted from a URL withgetURLKey(URL, String)
Deprecated. this method is intended for terminal implementation only and
is subject to change/removal from the interface (to
AbstractCommunicationManager
)
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.
isApplicationResourceURL
@Deprecated
boolean isApplicationResourceURL(URL context,
String relativeUri)
- Parameters:
context
-relativeUri
-- Returns:
Deprecated. this method is intended for terminal implementation only and
is subject to change/removal from the interface (to
AbstractCommunicationManager
)
Tests if a URL is for an application resource (APP/...).
getURLKey
@Deprecated
String getURLKey(URL context,
String relativeUri)
- Parameters:
context
-relativeUri
-- Returns:
Deprecated. this method is intended for terminal implementation only and
is subject to change/removal from the interface (to
AbstractCommunicationManager
)
Gets the identifier (key) from an application resource URL. This key is
the one that was given to
generateApplicationResourceURL(ApplicationResource, String)
when
creating the URL.