Eclipse Rich Ajax Platform

org.eclipse.rwt.application
Class Application

java.lang.Object
  extended by org.eclipse.rwt.application.Application

public class Application
extends java.lang.Object

This class represents an instance of an RWT web application at runtime.

An Application shares the same scope and life cycle as the ServletContext. In order to serve requests for an RWT application, an Application must be created and started for the ServletContext which receives the requests.

To create an Application, the ServletContext it should be bound to must be given along with an ApplicationConfigurator with which clients can configure the application before it is started. Usually, the Application is constructed and started in the contextInitialized() method of a ServletContextListener and stopped in its contextDestroyed() method.

Alternatively this task can be delegated to the RWTServletContextListener. If this class is specified as a listener in the deployment descriptor (web.xml), it starts an Application when the servlet context is initialized and stops it when the servlet context is destroyed. The RWTServletContextListener looks for an org.eclipse.rwt.Configurator init-parameter. Its value is assumed to be a class that implements ApplicationConfigurator and is used to configure the application.

Note: This API is provisional. It is likely to change before the final release.

Since:
1.5
See Also:
ApplicationConfigurator, RWTServletContextListener, javax.servlet.ServletContext, javax.servlet.ServletContextListener

Field Summary
static java.lang.String RESOURCES
           
 
Constructor Summary
Application(ApplicationConfigurator configurator, ServletContext servletContext)
          Constructs a new instance of this class given a configurator and the servlet context it is bound to.
 
Method Summary
 java.lang.String[] getServletNames()
          Returns an array of all sevlet names that are provided by this application.
 void start()
          Starts this application.
 void stop()
          Stops this application if it is running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCES

public static final java.lang.String RESOURCES
Constructor Detail

Application

public Application(ApplicationConfigurator configurator,
                   ServletContext servletContext)
Constructs a new instance of this class given a configurator and the servlet context it is bound to.

Parameters:
configurator - the the configurator to configure the application. Must not be null.
servletContext - the servlet context this application is bound to. Must not be null.
Method Detail

start

public void start()
Starts this application.

Throws:
java.lang.IllegalStateException - if this apllication was already started.

stop

public void stop()
Stops this application if it is running. Calling stop() on a non-running application does nothing.


getServletNames

public java.lang.String[] getServletNames()
Returns an array of all sevlet names that are provided by this application.

Note: This is not the actual structure used by the receiver to maintain its list of servlet names, so modifying the array will not affect the receiver.

Returns:
all servlet names provided by this application. Returns an empty array if no servlet names are provided.

Eclipse Rich Ajax Platform

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