javax.slee.resource
Class EventFlags

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

public final class EventFlags
extends java.lang.Object

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

A Resource Adaptor specifies event flags when submitting an event using the SleeEndpoint.fireEvent(ActivityHandle, FireableEventType, Object, javax.slee.Address, ReceivableService, int), SleeEndpoint.fireEventTransacted(ActivityHandle, FireableEventType, Object, javax.slee.Address, ReceivableService, int) methods.

Since:
SLEE 1.1

Field Summary
static int NO_FLAGS
          Requests no additional behavior from the SLEE.
static int REQUEST_EVENT_UNREFERENCED_CALLBACK
          Request an ResourceAdaptor.eventUnreferenced(javax.slee.resource.ActivityHandle, javax.slee.resource.FireableEventType, java.lang.Object, javax.slee.Address, javax.slee.resource.ReceivableService, int) callback from the SLEE when the SLEE no longer holds a reference to the event.
static int REQUEST_PROCESSING_FAILED_CALLBACK
          Request an ResourceAdaptor.eventProcessingFailed(javax.slee.resource.ActivityHandle, javax.slee.resource.FireableEventType, java.lang.Object, javax.slee.Address, javax.slee.resource.ReceivableService, int, javax.slee.resource.FailureReason) callback from the SLEE if the SLEE is unable to successfully process the event.
static int REQUEST_PROCESSING_SUCCESSFUL_CALLBACK
          Request an ResourceAdaptor.eventProcessingSuccessful(javax.slee.resource.ActivityHandle, javax.slee.resource.FireableEventType, java.lang.Object, javax.slee.Address, javax.slee.resource.ReceivableService, int) callback from the SLEE if the event is successfully processed.
static int SBB_PROCESSED_EVENT
          This flag is set by the SLEE if an SBB event handler method was invoked for the event.
static int SLEE_MAY_MARSHAL
          Indicate to the SLEE that the SLEE may marshal and unmarshal the event if required to do so.
static int STANDARD_FLAGS_MASK
          This bit-mask specifies the event flag bits reserved for current and future use by the JAIN SLEE specification.
static int VENDOR_FLAGS_MASK
          This mask specifies the event 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 a flag.
static boolean hasNoFlags(int flags)
          Determine whether the specified event flags request no special behavior.
static boolean hasRequestEventReferenceReleasedCallback(int flags)
          Test for the presence of the REQUEST_EVENT_UNREFERENCED_CALLBACK flag.
static boolean hasRequestProcessingFailedCallback(int flags)
          Test for the presence of the REQUEST_PROCESSING_FAILED_CALLBACK flag.
static boolean hasRequestProcessingSuccessfulCallback(int flags)
          Test for the presence of the REQUEST_PROCESSING_SUCCESSFUL_CALLBACK flag.
static boolean hasSbbProcessedEvent(int flags)
          Test for the presence of the SBB_PROCESSED_EVENT 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 setRequestEventReferenceReleasedCallback(int currentFlags)
          Add the REQUEST_EVENT_UNREFERENCED_CALLBACK flag to an existing integer representation of event flags.
static int setRequestProcessingFailedCallback(int currentFlags)
          Add the REQUEST_PROCESSING_FAILED_CALLBACK flag to an existing integer representation of event flags.
static int setRequestProcessingSuccessfulCallback(int currentFlags)
          Add the REQUEST_PROCESSING_SUCCESSFUL_CALLBACK flag to an existing integer representation of event flags.
static int setSbbProcessedEvent(int currentFlags)
          Add the SBB_PROCESSED_EVENT flag to an existing integer representation of event flags.
static int setSleeMayMarshal(int currentFlags)
          Add the SLEE_MAY_MARSHAL flag to an existing integer representation of event flags.
static java.lang.String toString(int flags)
          Get a string representation of an integer containing event 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 event if required to do so. If this flag is specified the Resource Adaptor must provide an implementation of the Marshaler interface that is capable of marshaling events.

See Also:
Marshaler.marshalEvent(javax.slee.resource.FireableEventType, java.lang.Object, java.io.DataOutput), Marshaler.unmarshalEvent(javax.slee.resource.FireableEventType, java.io.DataInput), Constant Field Values

REQUEST_PROCESSING_SUCCESSFUL_CALLBACK

public static final int REQUEST_PROCESSING_SUCCESSFUL_CALLBACK
Request an ResourceAdaptor.eventProcessingSuccessful(javax.slee.resource.ActivityHandle, javax.slee.resource.FireableEventType, java.lang.Object, javax.slee.Address, javax.slee.resource.ReceivableService, int) callback from the SLEE if the event is successfully processed.

See Also:
Constant Field Values

REQUEST_PROCESSING_FAILED_CALLBACK

public static final int REQUEST_PROCESSING_FAILED_CALLBACK
Request an ResourceAdaptor.eventProcessingFailed(javax.slee.resource.ActivityHandle, javax.slee.resource.FireableEventType, java.lang.Object, javax.slee.Address, javax.slee.resource.ReceivableService, int, javax.slee.resource.FailureReason) callback from the SLEE if the SLEE is unable to successfully process the event.

See Also:
Constant Field Values

REQUEST_EVENT_UNREFERENCED_CALLBACK

public static final int REQUEST_EVENT_UNREFERENCED_CALLBACK
Request an ResourceAdaptor.eventUnreferenced(javax.slee.resource.ActivityHandle, javax.slee.resource.FireableEventType, java.lang.Object, javax.slee.Address, javax.slee.resource.ReceivableService, int) callback from the SLEE when the SLEE no longer holds a reference to the event.

See Also:
Constant Field Values

SBB_PROCESSED_EVENT

public static final int SBB_PROCESSED_EVENT
This flag is set by the SLEE if an SBB event handler method was invoked for the event. A Resource Adaptor should not set this flag but should instead test for its presence in an event processing callback method.

See Also:
Constant Field Values

STANDARD_FLAGS_MASK

public static final int STANDARD_FLAGS_MASK
This bit-mask specifies the event 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 mask specifies the event 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 event flags request no special behavior.

Parameters:
flags - integer representation of a set of event 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 event 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 event 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 a flag.

Parameters:
flags - integer representation of a set of event 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 event flags to test.
Returns:
true if the flags include the SLEE_MAY_MARSHAL flag, false otherwise.

hasRequestProcessingSuccessfulCallback

public static boolean hasRequestProcessingSuccessfulCallback(int flags)
Test for the presence of the REQUEST_PROCESSING_SUCCESSFUL_CALLBACK flag.

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

hasRequestProcessingFailedCallback

public static boolean hasRequestProcessingFailedCallback(int flags)
Test for the presence of the REQUEST_PROCESSING_FAILED_CALLBACK flag.

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

hasRequestEventReferenceReleasedCallback

public static boolean hasRequestEventReferenceReleasedCallback(int flags)
Test for the presence of the REQUEST_EVENT_UNREFERENCED_CALLBACK flag.

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

hasSbbProcessedEvent

public static boolean hasSbbProcessedEvent(int flags)
Test for the presence of the SBB_PROCESSED_EVENT flag.

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

setSleeMayMarshal

public static int setSleeMayMarshal(int currentFlags)
Add the SLEE_MAY_MARSHAL flag to an existing integer representation of event 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 event flags.
Returns:
an integer equivalent to the input event flags with the SLEE_MAY_MARSHAL flag set.

setRequestProcessingSuccessfulCallback

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

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

setRequestProcessingFailedCallback

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

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

setRequestEventReferenceReleasedCallback

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

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

setSbbProcessedEvent

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

Note that this method should not be invoked by Resource Adaptors. This flag is used by the SLEE to report SBB event processing activity in the SLEE.

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

toString

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

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


Copyright © 2008. All Rights Reserved.