javax.slee.resource
Class ActivityFlags

java.lang.Object
  extended by javax.slee.resource.ActivityFlags

public final class ActivityFlags
extends java.lang.Object

This class defines flags that a Resource Adaptor can use when creating an activity. These flags enable additional contracts between the SLEE and the Resource Adaptor relating to the activity to be used.

A Resource Adaptor specifies activity flags when creating an activity using the SleeEndpoint.startActivity(ActivityHandle, Object, int), SleeEndpoint.startActivitySuspended(ActivityHandle, Object, int), SleeEndpoint.startActivityTransacted(ActivityHandle, Object, int) methods.

Since:
SLEE 1.1

Field Summary
static int NO_FLAGS
          Requests no additional behavior from the SLEE.
static int REQUEST_ACTIVITY_UNREFERENCED_CALLBACK
          Request a ResourceAdaptor.activityUnreferenced(javax.slee.resource.ActivityHandle) callback from the SLEE when the activity is no longer referenced within the SLEE.
static int REQUEST_ENDED_CALLBACK
          Request an ResourceAdaptor.activityEnded(javax.slee.resource.ActivityHandle) callback from the SLEE when the activity has ended.
static int SLEE_MAY_MARSHAL
          Indicate to the SLEE that the SLEE may marshal and unmarshal the activity handle if required to do so.
static int STANDARD_FLAGS_MASK
          This bit-mask specifies the activity flag bits reserved for current and future use by the JAIN SLEE specification.
static int VENDOR_FLAGS_MASK
          This bit-mask specifies the activity flag bits reserved for SLEE vendors to represent optional proprietary behavior.
 
Method Summary
static boolean hasFlags(int flags, int flagsToTestFor)
          Test an integer for the presence of one or more flags.
static boolean hasNoFlags(int flags)
          Determine whether the specified activity flags request no special behavior.
static boolean hasRequestEndedCallback(int flags)
          Test for the presence of the REQUEST_ENDED_CALLBACK flag.
static boolean hasRequestSleeActivityGCCallback(int flags)
          Test for the presence of the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag.
static boolean hasSleeMayMarshal(int flags)
          Test for the presence of the SLEE_MAY_MARSHAL flag.
static boolean hasStandardFlags(int flags)
          Determine whether the specified flags request any of the SLEE specification defined special behavior.
static boolean hasVendorFlags(int flags)
          Determine whether the specified flags request any vendor specific behavior.
static int setRequestEndedCallback(int currentFlags)
          Add the REQUEST_ENDED_CALLBACK flag to an existing integer representation of activity flags.
static int setRequestSleeActivityGCCallback(int currentFlags)
          Add the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag to an existing integer representation of activity flags.
static int setSleeMayMarshal(int currentFlags)
          Add the SLEE_MAY_MARSHAL flag to an existing integer representation of activity flags.
static java.lang.String toString(int flags)
          Get a string representation of an integer containing activity flags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_FLAGS

public static final int NO_FLAGS
Requests no additional behavior from the SLEE.

See Also:
Constant Field Values

SLEE_MAY_MARSHAL

public static final int SLEE_MAY_MARSHAL
Indicate to the SLEE that the SLEE may marshal and unmarshal the activity handle if required to do so. If this flag is specified the Resource Adaptor must provide a implementation of the Marshaler interface that is capable of marshaling activities.

See Also:
Marshaler.marshalHandle(javax.slee.resource.ActivityHandle, java.io.DataOutput), Marshaler.unmarshalHandle(java.io.DataInput), Constant Field Values

REQUEST_ENDED_CALLBACK

public static final int REQUEST_ENDED_CALLBACK
Request an ResourceAdaptor.activityEnded(javax.slee.resource.ActivityHandle) callback from the SLEE when the activity has ended.

See Also:
Constant Field Values

REQUEST_ACTIVITY_UNREFERENCED_CALLBACK

public static final int REQUEST_ACTIVITY_UNREFERENCED_CALLBACK
Request a ResourceAdaptor.activityUnreferenced(javax.slee.resource.ActivityHandle) callback from the SLEE when the activity is no longer referenced within the SLEE.

See Also:
Constant Field Values

STANDARD_FLAGS_MASK

public static final int STANDARD_FLAGS_MASK
This bit-mask specifies the activity flag bits reserved for current and future use by the JAIN SLEE specification. Bits 0-23 are reserved for use by the SLEE specification.

See Also:
Constant Field Values

VENDOR_FLAGS_MASK

public static final int VENDOR_FLAGS_MASK
This bit-mask specifies the activity flag bits reserved for SLEE vendors to represent optional proprietary behavior. Bits 24-31 are reserved for use by SLEE vendors.

See Also:
Constant Field Values
Method Detail

hasNoFlags

public static boolean hasNoFlags(int flags)
Determine whether the specified activity flags request no special behavior.

Parameters:
flags - integer representation of a set of activity flags to test.
Returns:
true if the flags define no special behavior, false otherwise.

hasStandardFlags

public static boolean hasStandardFlags(int flags)
Determine whether the specified flags request any of the SLEE specification defined special behavior.

Parameters:
flags - integer representation of a set of activity flags to test.
Returns:
true if the flags define any SLEE defined special behavior, false otherwise.

hasVendorFlags

public static boolean hasVendorFlags(int flags)
Determine whether the specified flags request any vendor specific behavior.

Parameters:
flags - integer representation of a set of activity flags to test.
Returns:
true if the flags define any vendor defined special behavior, false otherwise.

hasFlags

public static boolean hasFlags(int flags,
                               int flagsToTestFor)
Test an integer for the presence of one or more flags.

Parameters:
flags - integer representation of a set of activity flags to test.
flagsToTestFor - the flags to test for. This may include flags defined by this class and/or vendor specific flags.
Returns:
true if the specified flags are set, false otherwise.

hasSleeMayMarshal

public static boolean hasSleeMayMarshal(int flags)
Test for the presence of the SLEE_MAY_MARSHAL flag.

Parameters:
flags - integer representation of a set of activity flags to test.
Returns:
true if the flags include the SLEE_MAY_MARSHAL flag, false otherwise.

hasRequestEndedCallback

public static boolean hasRequestEndedCallback(int flags)
Test for the presence of the REQUEST_ENDED_CALLBACK flag.

Parameters:
flags - integer representation of a set of activity flags to test.
Returns:
true if the flags include the REQUEST_ENDED_CALLBACK flag, false otherwise.

hasRequestSleeActivityGCCallback

public static boolean hasRequestSleeActivityGCCallback(int flags)
Test for the presence of the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag.

Parameters:
flags - integer representation of a set of activity flags to test.
Returns:
true if the flags include the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag, false otherwise.

setSleeMayMarshal

public static int setSleeMayMarshal(int currentFlags)
Add the SLEE_MAY_MARSHAL flag to an existing integer representation of activity flags. The new flag is bitwise OR'ed onto the existing flags. This method has no effect if the SLEE_MAY_MARSHAL flag is already present in the existing flags.

Parameters:
currentFlags - the existing integer representation of activity flags.
Returns:
an integer equivalent to the input activity flags with the SLEE_MAY_MARSHAL flag set.

setRequestEndedCallback

public static int setRequestEndedCallback(int currentFlags)
Add the REQUEST_ENDED_CALLBACK flag to an existing integer representation of activity flags. The new flag is bitwise OR'ed onto the existing flags. This method has no effect if the REQUEST_ENDED_CALLBACK flag is already present in the existing flags.

Parameters:
currentFlags - the existing integer representation of activity flags.
Returns:
an integer equivalent to the input activity flags with the REQUEST_ENDED_CALLBACK flag set.

setRequestSleeActivityGCCallback

public static int setRequestSleeActivityGCCallback(int currentFlags)
Add the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag to an existing integer representation of activity flags. The new flag is bitwise OR'ed onto the existing flags. This method has no effect if the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag is already present in the existing flags.

Parameters:
currentFlags - the existing integer representation of activity flags.
Returns:
an integer equivalent to the input activity flags with the REQUEST_ACTIVITY_UNREFERENCED_CALLBACK flag set.

toString

public static java.lang.String toString(int flags)
Get a string representation of an integer containing activity flags.

Parameters:
flags - integer representation of a set of activity flags.
Returns:
a string representation containing all the SLEE specification defined activity flags and a hex representation of any vendor defined flags.


Copyright © 2009. All Rights Reserved.