# Enum Class Application.OperationMode

java.lang.Object
java.lang.Enum<Application.OperationMode>
org.eclipse.rap.rwt.application.Application.OperationMode

All Implemented Interfaces:
  `Serializable, Comparable<Application.OperationMode>, Constable`

Enclosing interface:
  `Application`

public static enum Application.OperationMode extends Enum<Application.OperationMode>
Instances of this class represent a mode of operation for an RWT application. The major difference between the operation modes is whether a separate UI thread is started for every session (SWT_COMPATIBILITY) or not (JEE_COMPATIBILITY).

Since:
  2.0

## Nested Class Summary

### Nested classes/interfaces inherited from class Enum

`Enum.EnumDesc<E>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`JEE_COMPATIBILITY`
In this mode, the request thread will be marked as UI thread in SWT.
`SESSION_FAILOVER`
This mode behaves just like `JEE_COMAPTIBILTIY` but in addition it registers the required servlet filter to support clustering.
`SWT_COMPATIBILITY`
In this mode, a separate UI thread will be started for each user session.

## Method Summary

Modifier and Type
Method
Description
`static Application.OperationMode`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static Application.OperationMode[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

### Methods inherited from class Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### JEE_COMPATIBILITY

public static final Application.OperationMode JEE_COMPATIBILITY
In this mode, the request thread will be marked as UI thread in SWT. Information that is attached to the request thread, such as security or transaction contexts, can be directly accessed. This mode is compatible with the JEE specification.

As its only limitation, it does not support the SWT main loop (more specifically, the method `Display.sleep()` is not implemented). As a consequence, blocking dialogs aren't possible with this operation mode. As an alternative to blocking dialogs, the class `Dialog` provides a non-blocking `open` method that accepts a callback to react on the closing of a dialog. Moreover, the blocking `Browser` methods `execute` and `evaluate` are not supported in this mode. A non-blocking `evaluate` method exists that also accepts a callback.

Unless there is a need for blocking dialogs (e.g. when using the Eclipse workbench), this mode is recommended as it is more lightweight than `SWT_COMPATIBILITY` .

### SWT_COMPATIBILITY

public static final Application.OperationMode SWT_COMPATIBILITY
In this mode, a separate UI thread will be started for each user session. All UI requests are processed in this thread while the request thread is put on hold. After processing all events, the method `Display.sleep()` lets the request thread continue and puts the UI thread to sleep. This approach fully supports the SWT main loop and thus also allows for blocking dialogs.

Information that is attached to the request thread, such as security or transaction contexts, can only be accessed using the method `RWT.requestThreadExec(Runnable)`.

### SESSION_FAILOVER

public static final Application.OperationMode SESSION_FAILOVER
This mode behaves just like `JEE_COMAPTIBILTIY` but in addition it registers the required servlet filter to support clustering. This mode requires the servlet API 3.0.

## Method Details

### values

public static Application.OperationMode[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

Returns:
  an array containing the constants of this enum class, in the order they are declared

### valueOf

public static Application.OperationMode valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum class has no constant with the specified name
  `NullPointerException` - if the argument is null