WebSphere Application Server - Express, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Using the AccessIntent API

Why and when to perform this task

This task describes how to programmatically retrieve and call the AccessIntent API during the execution of BMP entity bean methods.

Steps for this task

  1. Look up the current access intent in the namespace. For example:
    InitialContext ic = new InitialContext(); 
    AccessIntent ai = ic.lookup("java:comp/websphere/AppProfile/AccessIntent"); 
  2. Call the necessary get() methods. For example:
    int concurrency = ai.getConcurrencyControl(); 
    int accessType = ai.getAccessType(); 
    if ( (concurrency == AccessIntent.CONCURRENCY_CONTROL_PESSIMISTIC) 
       && (accessType == AccessIntent.ACCESS_TYPE_UPDATE) ) {
         int exclusive = ai.getPessimisticUpdateLockHint(); 
         // . . . 
    } 
    // . . . 

Result

Note: The access intent object reference retrieved from the java:comp lookup is current for the duration of the method in which the reference was looked up. Depending on how you configured the application profile, subsequent calls of the same method might not retrieve the same access intent reference. You can only look up the object reference during the call of a BMP entity bean's method; the reference does not exist during a request on a CMP entity bean. Therefore, access intent object references should not be cached beyond, or used outside of, the scope of the execution of any given BMP method.



Sub-topics
AccessIntent interface

Related information
Access intent with BMP entity beans
Access intent policies
Task overview: Application profiling

Task topic    

Terms of Use | Feedback

Last updated: Jun 8, 2005 12:45:23 PM EDT
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/ae/tejb_axiapi.html

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