+

Search Tips   |   Advanced Search

 

Retrieving work area properties

 

 

Overview

Properties can be retrieved from a work area by using the get method. This method is intentionally lightweight; there are no declared exceptions to handle. If there is no active work area, or if there is no such property set in the current work area, the get method returns null.

The get method can raise a NotSerializableError in the relatively rare scenario in which CORBA clients set composed data types and invoke enterprise-bean interfaces.

 

Example

The following example shows the retrieval of the site-identifier and priority properties by the SimpleSampleBean. Notice that one property was set into an outer work area by the client, and the other property was set into the nested work area by the server-side bean; the nesting is transparent to the retrieval of the properties.

public class SimpleSampleBeanImpl implements SessionBean {

    public String [] test() {
      ...

      // Begin a nested work area.
      userWorkArea.begin("SimpleSampleBean");
      try {
        userWorkArea.set("company",
                         SimpleSampleCompany.London_Development);
      }
      catch (NotOriginator e) {
      }

      SimpleSampleCompany company =
         (SimpleSampleCompany) userWorkArea.get("company");
      SimpleSamplePriority priority =
         (SimpleSamplePriority) userWorkArea.get("priority");
       ...   }
}


 

What to do next

For additional information about work areas, see the package, com.ibm.websphere.workarea, in the API documentation. The generated API documentation is available in the information center table of contents from the path Reference > Developer > API documentation > Application programming interfaces.



Work area property modes
Nested work areas