Eclipse Remote Application Platform

org.eclipse.rap.rwt.service
Interface ApplicationContext

All Superinterfaces:
IApplicationStore

public interface ApplicationContext
extends IApplicationStore

An application context represents a running instance of a RAP application. This context is shared by all users who access this application. The current application context can be acquired by RWT.getApplicationContext(). It can be used to store any data that is shared between all UI sessions of an application, and to acquire application-scoped instances of framework services such as the resource manager.

The application context is bound to the servlet context of the hosting web application. It is destroyed when the web application ends (i.e. the servlet context is destroyed) or when the application is explicitly stopped by calling ApplicationRunner.stop().

The application context is thread safe, it can be accessed concurrently from different threads.

Since:
2.0
See Also:
RWT

Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns the value which is stored under the given name in this application context.
 ResourceManager getResourceManager()
          Returns the instance of the resource manager for this application context.
 ServiceManager getServiceManager()
          Returns the instance of the service manager for this application context.
 void removeAttribute(java.lang.String name)
          Removes the object which is stored under the given name in this application context.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Stores the given value in this application context, associated with the given name.
 

Method Detail

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)
Stores the given value in this application context, associated with the given name. If another value has already been stored with the given name, the old value is overwritten.

Specified by:
setAttribute in interface IApplicationStore
Parameters:
name - the name to associate the value with
value - the object to be stored

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Returns the value which is stored under the given name in this application context.

Specified by:
getAttribute in interface IApplicationStore
Parameters:
name - the name whose associated value is requested
Returns:
the object that is stored, or null if no object has been stored by that name

removeAttribute

void removeAttribute(java.lang.String name)
Removes the object which is stored under the given name in this application context. If no value object was stored under the given name, this method does nothing.

Specified by:
removeAttribute in interface IApplicationStore

getResourceManager

ResourceManager getResourceManager()
Returns the instance of the resource manager for this application context. The resource manager is used to register static resources such as images of JavaScript files.

Returns:
the resource manager for this application context
See Also:
ResourceManager

getServiceManager

ServiceManager getServiceManager()
Returns the instance of the service manager for this application context. The service manager is used to register and unregister service handlers.

Returns:
the service manager instance for this application context
See Also:
ServiceManager, ServiceHandler

Eclipse Remote Application Platform

Copyright (c) EclipseSource and others 2002, 2012. All rights reserved.