com.ibm.websphere.appprofile

Interface TaskNameManager



  • public interface TaskNameManager
    The TaskNameManager is the programmatic interface to the Application profiling function. Application profiling enables you to identify particular units of work to the WebSphere Application Server run time environment. The run time can tailor its support to the exact requirements of that unit of work. Access intent is currently the only run time component that makes use of the application profiling functionality. For example, you can configure one transaction to load an entity bean with strong update locks and configure another transaction to load the same entity bean without locks.

    Application profiling introduces two concepts in order to achieve this function: tasks and profiles.

    A task is a configurable name for a unit of work. Unit of work in this case means either a transaction or an ActivitySession.

    A profile is simply a mapping of a task to a set of access intent policies that are configured on entity beans. When an invocation on a bean (whether by a finder method, a CMR getter, or a dynamic query) requires data to be retrieved from the back end system, the task of the active unit of work associated with the request is used to determine the exact requirement of the transaction. The same bean loads and behaves differently in the context of the task-to-profile mapping. Each profile provides the developer an opportunity to reconfigure the application's access intent.

    Programmers can declaratively configure container managed tasks for J2EE web components, application clients, and Enterprise JavaBeans (EJBs). On rare occasions, it may be necessary to programatically set the current task name. Application profiling supports this requirement with the TaskNameManager interface that enables both overriding of the current task associated with the thread of execution, and resetting of the current task with the original task.

    Except for J2EE 1.3 applications that are executing on a server where the 5.x Compatibility Mode attribute is selected, this interface cannot be used within Enterprise JavaBeans that are configured for container-managed transactions or container-managed ActivitySessions because units of work can only be associated with a task at the exact time that the unit of work is initiated. The call to set the task name must therefore be invoked before the unit of work is begun. Units of work cannot be named after they are begun. Calls on this interface during the execution of a container-managed unit of work are simply ignored.

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void resetTaskName()
      Sets the thread's task name to the value that was set at or imported into the beginning of the method invocation (for ejb and web components) or process (for J2EE clients).
      void setTaskName(java.lang.String taskName)
      Set the thread's current task name to the specified parameter.
    • Method Detail

      • setTaskName

        void setTaskName(java.lang.String taskName)
                         throws IllegalTaskNameException
        Set the thread's current task name to the specified parameter. The task name must have been configured as a task reference with a corresponding task or the IllegalTaskName exception will be thrown.
        Parameters:
        taskName - Not null String that must have been properly linked in the deployment descriptors.
        Throws:
        IllegalTaskNameException - Thrown if the task name is null or not declared properly in the deployment descriptor.
      • resetTaskName

        void resetTaskName()
        Sets the thread's task name to the value that was set at or imported into the beginning of the method invocation (for ejb and web components) or process (for J2EE clients).
IBM WebSphere Application ServerTM
Release 8.5