Retrieving the name of the active work area

 

Overview

Applications use the getName method on the UserWorkArea interface to retrieve the name of the current work area. This is the recommended method for determining whether the thread is associated with a work area; if the thread is not associated with a work area, the getName method returns null. In the following code example, the name of the work area corresponds to the name of the class in which the work area was begun.

 

Example

public class SimpleSampleBeanImpl implements SessionBean {

    ...

    public String [] test() {
       // Get the work-area reference from JNDI.
       ...

       // Retrieve the name of the work area. In this example,
       // the name is used to identify the class in which the
       // work area was begun.
       String invoker = userWorkArea.getName();
       ...
   }
}


 

Related Tasks


Overriding work area properties
Retrieving work area properties
Retrieving a list of all keys in a work area
Querying the mode of a work area property
Delete a work area property