com.ibm.websphere.workarea

Interface UserWorkArea

  • All Superinterfaces:
    java.io.Serializable


    public interface UserWorkArea
    extends java.io.Serializable
    The UserWorkArea interface defines the methods that allow an application to define and populate contextual boundaries. Remote method calls that originate from within a contextual boundary will automatically propagate the boundary information and the contained context so that the remote methods will operate within a client's context. This context is explicitely thread-scoped; two threads may never share the same context. Contexts may be nested; an inner context will automatically inherit the outer context; changes made within an inner context will be removed when the inner context is completed and the outer context will be restored to its state before the inner context was begun. Note that changes made on a remote node will not be propagated back upstream into the invoking client's context if the partition is defined to be unidirectional. Changes made on a remote node will be propagated back upstream into the invoking client's context if the partition is defined to be bidirectional. Note that the UserWorkArea reference is only to be used within application-defined methods; the UserWorkArea methods should not be invoked from within ejb framework methods, servlet initialization, etc; attempts to do so will likely result in an InvalidState exception. Successful invocations outside application logic will not be guaranteed in any future releases.
    Version:
    1.0
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void begin(java.lang.String name)
      Begin a new WorkArea associated with it the current thread.
      void complete()
      Will complete the current, active WorkArea and will lose the references to any contained context.
      java.io.Serializable get(java.lang.String key)
      The get operation will search the current WorkArea for a corresponding property.
      PropertyModeType getMode(java.lang.String key)
      The getMode operation will search the current WorkArea for a corresponding property's mode.
      java.lang.String getName()
      Returns the context's name.
      void remove(java.lang.String key)
      Removes property from current WorkArea scope.
      java.lang.String[] retrieveAllKeys()
      Returns an array of all keys associated with the stack of WorkAreas for the current thread.
      void set(java.lang.String key, java.io.Serializable value)
      Set the specified property.
      void set(java.lang.String key, java.io.Serializable value, PropertyModeType mode)
      Sets given property by mode.
    • Method Detail

      • begin

        void begin(java.lang.String name)
        Begin a new WorkArea associated with it the current thread. If there was already a WorkArea associated with the thread, a new WorkArea will nest within the already-existing WorkArea.
        Parameters:
        name - The name that will be associated with this WorkArea. Note that the WorkArea service attaches no meaning to this name; it is instead to be used by the application as desired. The WorkArea service requires only that the name not be null.
        Throws:
        java.lang.NullPointerException - Thrown if the name reference is null.
      • complete

        void complete()
                      throws NoWorkArea,
                             NotOriginator
        Will complete the current, active WorkArea and will lose the references to any contained context. If there is a parent context, that context will automatically become the current context.
        Throws:
        NoWorkArea - Thrown if there is no active WorkArea associated with the current thread.
        NotOriginator - Thrown if the WorkArea was imported from another process.
      • getName

        java.lang.String getName()
        Returns the context's name. Returns null if there is no active context. This is the suggested method for determining if there is an active WorkArea associated with the current thread.
        Returns:
        the name of the context.
      • retrieveAllKeys

        java.lang.String[] retrieveAllKeys()
        Returns an array of all keys associated with the stack of WorkAreas for the current thread. The keys are returned with no guarantee of order. Returns null if there are no keys or if there is no active context.
        Returns:
        Array of strings.
      • set

        void set(java.lang.String key,
               java.io.Serializable value)
                 throws NoWorkArea,
                        NotOriginator,
                        PropertyReadOnly
        Set the specified property. PropertyModeType defaults to normal.
        Parameters:
        key - May not be null.
        value - May not be null.
        Throws:
        NoWorkArea - Thrown if there is no active WorkArea associated with the thread.
        NotOriginator - Thrown if the active WorkArea was imported from another process.
        PropertyReadOnly - Thrown if the corresponding property was set as read_only.
        java.lang.NullPointerException - Thrown if the key is null.
      • set

        void set(java.lang.String key,
               java.io.Serializable value,
               PropertyModeType mode)
                 throws NoWorkArea,
                        NotOriginator,
                        PropertyReadOnly
        Sets given property by mode.
        Parameters:
        key - May not be null.
        value - May not be null.
        mode - May not be null.
        Throws:
        NoWorkArea - Thrown if there is no active WorkArea associated with the thread.
        NotOriginator - Thrown if the active WorkArea was imported from another process.
        PropertyReadOnly - Thrown if the corresponding property was set as read_only.
        java.lang.NullPointerException - Thrown if the key or mode is null.
      • get

        java.io.Serializable get(java.lang.String key)
        The get operation will search the current WorkArea for a corresponding property. If no value is found, the search will automatically continue through the hierarchy of nested WorkAreas. Null is returned if there is no associated property or if there is no active WorkArea.
        Parameters:
        key - The key to search by. May not be null.
        Returns:
        found value or null.
        Throws:
        NotSerializableError - Thrown if the corresponding is not serializable (i.e., was set via a CORBA interface)
        java.lang.NullPointerException - Thrown if the key is null.
      • getMode

        PropertyModeType getMode(java.lang.String key)
        The getMode operation will search the current WorkArea for a corresponding property's mode. If no value is found, the search will automatically continue through the hierarchy of nested WorkAreas. PropertyModeType.normal is returned if there is no associated property or if there is no active WorkArea. Note that null is not returned; normal mode implies that properties are not set to a higher level of control, not that any property already exists.
        Parameters:
        key - The key to search by. May not be null.
        Returns:
        found value or null.
        Throws:
        java.lang.NullPointerException - Thrown if the key is null.
      • remove

        void remove(java.lang.String key)
                    throws NoWorkArea,
                           NotOriginator,
                           PropertyFixed
        Removes property from current WorkArea scope. Note that this operation will not remove value from outer levels of context.
        Parameters:
        key - May not be null.
        Throws:
        NoWorkArea - Thrown if there is no active WorkArea associated with the thread.
        NotOriginator - Thrown if the operation is invoked against a WorkArea imported from another process.
        PropertyFixed - Thrown if the property was set as fixed.
        java.lang.NullPointerException - Thrown if the key is null.
IBM WebSphere Application ServerTM
Release 9.0