WebSphere Application Server Network Deployment, Version 6.0.x   Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
             [TIP: Focusing the table of contents and search results]

Accessing a user defined work area partition

About this task

The work area partition service provides a Java Naming and Directory Interface (JNDI) binding to an implementation of the work area partition manager interface under the name java:comp/websphere/WorkAreaPartitionManager. Applications that need to access their partition can perform a lookup on that JNDI name and then use the getWorkAreaPartition method on the work area partition manager, as shown in the following code example:

Example

import com.ibm.websphere.workarea.*;
import javax.naming.*;

public class SimpleSampleServlet {
  ...

         //Variable to hold our WorkAreaPartitionManager implementation
         WorkAreaPartitionManager partitionManager = null;
         try {
             InitialContext initialContext = new InitialContext();
             partitionManager = (WorkAreaPartitionManager) 
            initialContext.lookup("java:comp/websphere/WorkAreaPartitionManager");
         } catch (Exception e) {...}

         //Variable used to hold the retrieved WorkArea Partition
         UserWorkArea myPartition = null;
         try{
             myPartition = partitionManager.getWorkAreaPartition(partitionName);
         }catch(NoSuchPartitionException e){...}
}

What to do next

The next step is to use the begin method to create a new work area and associate it with the calling thread, as described in the topic Beginning a new work area.



Related concepts
Overview of work area service
Work area partition service
Related tasks
Configuring work area partitions
Related reference
The Work area partition manager interface
Task topic    

Terms of Use | Feedback

Last updated: Mar 8, 2007 8:14:28 PM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/workarea/tasks/twa_partitionbinding.html

© Copyright IBM Corporation 2004, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)