Applications interact with the WorkArea service by implementing the UserWorkArea interface. This interface, shown below, defines all of the methods used to create, manipulate, and terminate work areas:
package com.ibm.websphere.workarea; public interface UserWorkArea { void begin(String name); void complete() throws NoWorkArea, NotOriginator; String getName(); String[] retrieveAllKeys(); void set(String key, java.io.Serializable value) throws NoWorkArea, NotOriginator, PropertyReadOnly; void set(String key, java.io.Serializable value, PropertyModeType mode) throws NoWorkArea, NotOriginator, PropertyReadOnly; java.io.Serializable get(String key); PropertyModeType getMode(String key); void remove(String key) throws NoWorkArea, NotOriginator, PropertyFixed; }
Note: EJB applications can use the UserWorkArea interface only within the implementation of methods in the remote interface; likewise, servlets can use the interface only within the service method of the HTTPServlet class. Use of work areas within any lifecycle method of a servlet or enterprise bean is considered a deviation from the work area programming model and is not supported.
Exceptions
The WorkArea service defines the following exceptions for use with the UserWorkArea interface: