public interface SleeEndpoint
SleeEndpoint
interface is implemented by the SLEE and provides a
Resource Adaptor with an access point into the SLEE for starting and ending activities,
and for firing events on those activities.
Activities may only be started when the resource adaptor object associated with the
SLEE Endpoint is in the Active state. Events may only be fired with the resource
adaptor object is in the Active or Stopping state. A resource adaptor object is
notified of state changes via the lifecycle callback methods on the ResourceAdaptor
interface.
Modifier and Type | Method and Description |
---|---|
void |
endActivity(ActivityHandle handle)
Notify the SLEE that an activity is ending.
|
void |
endActivityTransacted(ActivityHandle handle)
Notify the SLEE that an activity is ending.
|
void |
fireEvent(ActivityHandle handle,
FireableEventType eventType,
Object event,
Address address,
ReceivableService service)
Fire an event on an activity to the SLEE.
|
void |
fireEvent(ActivityHandle handle,
FireableEventType eventType,
Object event,
Address address,
ReceivableService service,
int eventFlags)
Fire an event on an activity to the SLEE.
|
void |
fireEventTransacted(ActivityHandle handle,
FireableEventType eventType,
Object event,
Address address,
ReceivableService service)
Fire an event on an activity to the SLEE.
|
void |
fireEventTransacted(ActivityHandle handle,
FireableEventType eventType,
Object event,
Address address,
ReceivableService service,
int eventFlags)
Fire an event on an activity to the SLEE.
|
void |
startActivity(ActivityHandle handle,
Object activity)
Notify the SLEE that a new activity has started.
|
void |
startActivity(ActivityHandle handle,
Object activity,
int activityFlags)
Notify the SLEE that a new activity has started.
|
void |
startActivitySuspended(ActivityHandle handle,
Object activity)
Notify the SLEE that a new activity has started, and that it is suspended.
|
void |
startActivitySuspended(ActivityHandle handle,
Object activity,
int activityFlags)
Notify the SLEE that a new activity has started, and that it is suspended.
|
void |
startActivityTransacted(ActivityHandle handle,
Object activity)
Notify the SLEE that a new activity has started.
|
void |
startActivityTransacted(ActivityHandle handle,
Object activity,
int activityFlags)
Notify the SLEE that a new activity has started.
|
void |
suspendActivity(ActivityHandle handle)
Suspend an activity within the context of the calling transaction.
|
void startActivity(ActivityHandle handle, Object activity) throws NullPointerException, IllegalStateException, ActivityAlreadyExistsException, StartActivityException, SLEEException
This method should be used by resource adaptors that start and end activities in a non-transactional manner.
This method is a non-transactional method.
This method is equivalent to
startActivity(handle, activity, ActivityFlags.NO_FLAGS)
.
handle
- the activity handle representing the new activity created by the
resource adaptor.NullPointerException
- if either handle
or activity
are null
.IllegalStateException
- if the resource adaptor object invoking this method
is not in the Active state.ActivityAlreadyExistsException
- if the activity handle represents an
activity that is already known by the SLEE. Once an activity is started,
the activity handle for the activity will remain known by the SLEE until
the SLEE notifies the resource adaptor that the activity has ended in
the SLEE via the activityEnded
callback.StartActivityException
- if the activity could not be started by the SLEE
where the reason is not a system-level failure such as input rate-limiting.SLEEException
- if the activity could not be started in the SLEE due to a
system-level failure.void startActivity(ActivityHandle handle, Object activity, int activityFlags) throws NullPointerException, IllegalStateException, ActivityAlreadyExistsException, StartActivityException, SLEEException
This method should be used by resource adaptors that start and end activities in a non-transactional manner.
A resource adaptor object may request various callback methods related to the
activity and activity handle by setting the appropriate
activity flags
in the activityFlags
argument.
This method is a non-transactional method.
handle
- the activity handle representing the new activity created by the
resource adaptor.activityFlags
- the activity flags
the activity should
be created with.NullPointerException
- if either the handle
or activity
are null
.IllegalStateException
- if the resource adaptor object invoking this method
is not in the Active state.ActivityAlreadyExistsException
- if the activity handle represents an
activity that is already known by the SLEE. Once an activity is started,
the activity handle for the activity will remain known by the SLEE until
the SLEE notifies the resource adaptor that the activity has ended in
the SLEE via the activityEnded
callback.StartActivityException
- if the activity could not be started by the SLEE
where the reason is not a system level failure such as input rate-limiting.SLEEException
- if the activity could not be started in the SLEE due to a
system-level failure.void startActivitySuspended(ActivityHandle handle, Object activity) throws NullPointerException, IllegalStateException, TransactionRequiredLocalException, ActivityAlreadyExistsException, StartActivityException, SLEEException
suspendActivity(javax.slee.resource.ActivityHandle)
for more information on suspending activities.
This method should be used by resource adaptors that start non-transacted activities outgoing from the SLEE.
This method is a mandatory transactional method. However it does not perform any transacted operation - the transaction must be present in order to suspend the activity.
This method is equivalent to
startActivitySuspended(handle, activity, ActivityFlags.NO_FLAGS)
.
handle
- the activity handle representing the new activity created by the
resource adaptor.NullPointerException
- if either the handle
or activity
are null
.IllegalStateException
- if the resource adaptor object invoking this method
is not in the Active state.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.ActivityAlreadyExistsException
- if the activity handle represents an
activity that is already known by the SLEE. Once an activity is started,
the activity handle for the activity will remain known by the SLEE until
the SLEE notifies the resource adaptor that the activity has ended in
the SLEE via the activityEnded
callback.StartActivityException
- if the activity could not be started by the SLEE
where the reason is not a system level failure such as input rate-limiting.SLEEException
- if the activity could not be started in the SLEE due to a
system-level failure.void startActivitySuspended(ActivityHandle handle, Object activity, int activityFlags) throws NullPointerException, IllegalStateException, TransactionRequiredLocalException, ActivityAlreadyExistsException, StartActivityException, SLEEException
suspendActivity(javax.slee.resource.ActivityHandle)
for more information on suspending activities.
This method should be used by resource adaptors that start non-transacted activities outgoing from the SLEE.
This method is a mandatory transactional method. However it does not perform any transacted operation - the transaction must be present in order to suspend the activity.
handle
- the activity handle representing the new activity created by the
resource adaptor.activityFlags
- the activity flags
the activity should
be created with.NullPointerException
- if either the handle
or activity
are null
.IllegalStateException
- if the resource adaptor object invoking this method
is not in the Active state.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.ActivityAlreadyExistsException
- if the activity handle represents an
activity that is already known by the SLEE. Once an activity is started,
the activity handle for the activity will remain known by the SLEE until
the SLEE notifies the resource adaptor that the activity has ended in
the SLEE via the activityEnded
callback.StartActivityException
- if the activity could not be started where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the activity could not be started in the SLEE due to a
system-level failure.void startActivityTransacted(ActivityHandle handle, Object activity) throws NullPointerException, IllegalStateException, TransactionRequiredLocalException, ActivityAlreadyExistsException, StartActivityException, SLEEException
This method should be used by resource adaptors that start and end activities in a transactional manner. For example, a Null Activity is started in a transacted manner.
This method is a mandatory transactional method.
This method is equivalent to
startActivityTransacted(handle, activity, ActivityFlags.NO_FLAGS)
.
handle
- the activity handle representing the new activity created by the
resource adaptor.NullPointerException
- if either the handle
or activity
are null
.IllegalStateException
- if the resource adaptor object invoking this method
is not in the Active state.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.ActivityAlreadyExistsException
- if the activity handle represents an
activity that is already known by the SLEE. Once an activity is started,
the activity handle for the activity will remain known by the SLEE until
the SLEE notifies the resource adaptor that the activity has ended in
the SLEE via the activityEnded
callback.StartActivityException
- if the activity could not be started where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the activity could not be started in the SLEE due to a
system-level failure.void startActivityTransacted(ActivityHandle handle, Object activity, int activityFlags) throws NullPointerException, IllegalStateException, TransactionRequiredLocalException, ActivityAlreadyExistsException, StartActivityException, SLEEException
This method should be used by resource adaptors that start and end activities in a transactional manner. For example, a Null Activity is started in a transacted manner.
A resource adaptor object may request various callback methods related to the
activity and activity handle by setting the appropriate
activity flags
in the activityFlags
argument.
This method is a mandatory transactional method.
handle
- the activity handle representing the new activity created by the
resource adaptor.activityFlags
- the activity flags
the activity should
be created with.NullPointerException
- if either the handle
or activity
are null
.IllegalStateException
- if the resource adaptor object invoking this method
is not in the Active state.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.ActivityAlreadyExistsException
- if the activity handle represents an
activity that is already known by the SLEE. Once an activity is started,
the activity handle for the activity will remain known by the SLEE until
the SLEE notifies the resource adaptor that the activity has ended in
the SLEE via the activityEnded
callback.StartActivityException
- if the activity could not be started where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the activity could not be started in the SLEE due to a
system-level failure.void suspendActivity(ActivityHandle handle) throws NullPointerException, TransactionRequiredLocalException, UnrecognizedActivityHandleException, SLEEException
Each suspension of an activity inserts a logical "event processing barrier" into the SLEE's internal processing state for the activity. Any events fired prior to the insertion of an event processing barrier may be processed and delivered by the SLEE as normal. Events fired after the insertion of an event processing barrier are not processed by the SLEE until the barrier is removed. A barrier is removed once the suspending transaction has completed (committed or rolled back).
An activity may have multiple barriers in its event queue at any given point in time, with events fired before and after the placement of each barrier.
This method is a mandatory transactional method. However it does not perform any transacted operation - the transaction must be present in order to suspend the activity.
handle
- the activity handle representing the activity to suspend.NullPointerException
- if handle
is null
.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.UnrecognizedActivityHandleException
- if the activity handle is not known
by the SLEE.SLEEException
- if the activity could not be enrolled in the transaction due
to a system-level failure.void endActivity(ActivityHandle handle) throws NullPointerException, UnrecognizedActivityHandleException
Activity End Event
is queued for processing
on the activity. Further events may not be fired on the activity, either by
Resource Adaptors or SBBs.
This method should be used by resource adaptors that start and end activities in a non-transactional manner (such as resource adaptors for non-transactional SS7 protocol stacks, SIP stacks, etc).
If this method is invoked for an activity whose Activity Context is already in the Ending state, this method has no further effect.
This method is a non-transactional method.
handle
- the activity handle representing the activity that is ending.NullPointerException
- if handle
is null
.UnrecognizedActivityHandleException
- if the activity handle is not known by
the SLEE. This exception will also be thrown if an activity is started via
the startActivityTransacted
method, the
transaction starting the activity has not yet committed, and this method is
used in an attempt to end the activity in a non-transacted manner. Until
the transaction commits, the started activity is only visible in the
context of the transaction that started it.void endActivityTransacted(ActivityHandle handle) throws NullPointerException, TransactionRequiredLocalException, UnrecognizedActivityHandleException
Activity End Event
will be queued for
processing on the activity. Further events may not be fired on the activity,
either by Resource Adaptors or SBBs. If the enclosing transaction commits, then
the transition to the Ending state will become permanent and visible to subsequent
transactions. If the transaction rolls back, then the SLEE will also roll back
the transition to the Ending state.
This method should be used by resource adaptors that start and end activities in
a transactional manner. For example, the
NullActivity.endActivity()
method ends a Null
Activity in a transacted manner.
This method is a mandatory transactional method.
handle
- the activity handle representing the activity that is ending.NullPointerException
- if handle
is null
.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.UnrecognizedActivityHandleException
- if the activity handle is not known
by the SLEE.void fireEvent(ActivityHandle handle, FireableEventType eventType, Object event, Address address, ReceivableService service) throws NullPointerException, UnrecognizedActivityHandleException, IllegalEventException, ActivityIsEndingException, FireEventException, SLEEException
This method should be used by resource adaptors that start and end activities in a non-transactional manner (such as resource adaptors for non-transactional SS7 protocol stacks, SIP stacks, etc) in response to events generated by the network or non-transactional API calls by SBBs.
The ordering of events fired via this method is self-consistent. Events fired on the same activity by a resource adaptor using this method from a single thread will be processed by the SLEE in the order that they were fired. However, no consistency guarantees are made between events fired from different threads, events fired on different activities, or between an event fired in a non-transacted manner and an event fired in a transacted manner, where both events are fired within the same transaction context.
This method is a non-transactional method.
This method is equivalent to
fireEvent(handle, eventType, event, address, service, EventFlags.NO_FLAGS)
.
handle
- the activity handle representing the activity that the event is
being fired on.eventType
- the event type of the event. FireableEventType
objects
can be obtained from the EventLookupFacility
.event
- the event object being fired.address
- the optional default address on which the event is being fired.
May be null
if no default address is specified.service
- the optional service that is the target recipient of the event.
If this argument is not null
, the SLEE will deliver the event
to interested SBBs in the specified service only. If this argument is
null
the event will be delivered to interested SBBs in all
active services. ReceivableService
objects may be obtained
from the ServiceLookupFacility
or from the
service lifecycle callback methods invoke on the resource adaptor object
such as ResourceAdaptor.serviceActive
.NullPointerException
- if handle
or event
is
null
.UnrecognizedActivityHandleException
- if the activity handle is not known by
the SLEE. This exception will also be thrown if an activity is started via
the startActivityTransacted
method, the
transaction starting the activity has not yet committed, and this method is
used in an attempt to fire an event on the activity in a non-transacted
manner. Until the transaction commits, the started activity is only visible
in the context of the transaction that started it.IllegalEventException
- if the specified event type is not a FireableEventType
object generated by the SLEE and provided to the resource adaptor via an
EventLookupFacility
, if the specified event type
is not an event type that the resource adaptor is permitted to fire (a resource
adaptor may only fire events of event types referenced by the resource adaptor
types it implements unless this restriction has been disabled in the resource
adaptor's deployment descriptor), or if the class of the event object is not
assignable to the event class of the event type.ActivityIsEndingException
- if the activity represented by the activity handle
is already ending in the SLEE. Once an Activity Context enters the Ending
state, no further events may be fired on the activity by SBBs or resource
adaptors.FireEventException
- if the SLEE could not accept the event for processing where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the event could not be accepted by the SLEE due to a
system-level failure.void fireEvent(ActivityHandle handle, FireableEventType eventType, Object event, Address address, ReceivableService service, int eventFlags) throws NullPointerException, UnrecognizedActivityHandleException, IllegalEventException, ActivityIsEndingException, FireEventException, SLEEException
This method should be used by resource adaptors that start and end activities in a non-transactional manner (such as resource adaptors for non-transactional SS7 protocol stacks, SIP stacks, etc) in response to events generated by the network or non-transactional API calls by SBBs.
The ordering of events fired via this method is self-consistent. Events fired on the same activity by a resource adaptor using this method from a single thread will be processed by the SLEE in the order that they were fired. However, no consistency guarantees are made between events fired from different threads, events fired on different activities, or between an event fired in a non-transacted manner and an event fired in a transacted manner, where both events are fired within the same transaction context.
A resource adaptor object may be notified of the outcome of event processing
by setting the appropriate event flags
in the eventFlags
argument.
This method is a non-transactional method.
handle
- the activity handle representing the activity that the event is
being fired on.eventType
- the event type of the event. FireableEventType
objects
can be obtained from the EventLookupFacility
.event
- the event object being fired.address
- the optional default address on which the event is being fired.
May be null
if no default address is specified.service
- the optional service that is the target recipient of the event.
If this argument is not null
, the SLEE will deliver the event
to interested SBBs in the specified service only. If this argument is
null
the event will be delivered to interested SBBs in all
active services. ReceivableService
objects may be obtained
from the ServiceLookupFacility
or from the
service lifecycle callback methods invoke on the resource adaptor object
such as ResourceAdaptor.serviceActive
.eventFlags
- the event flags
the event should be fired with.NullPointerException
- if handle
or event
is
null
.UnrecognizedActivityHandleException
- if the activity handle is not known by
the SLEE. This exception will also be thrown if an activity is started via
the startActivityTransacted
method, the
transaction starting the activity has not yet committed, and this method is
used in an attempt to fire an event on the activity in a non-transacted
manner. Until the transaction commits, the started activity is only visible
in the context of the transaction that started it.IllegalEventException
- if the specified event type is not a FireableEventType
object generated by the SLEE and provided to the resource adaptor via an
EventLookupFacility
, if the specified event type
is not an event type that the resource adaptor is permitted to fire (a resource
adaptor may only fire events of event types referenced by the resource adaptor
types it implements unless this restriction has been disabled in the resource
adaptor's deployment descriptor), or if the class of the event object is not
assignable to the event class of the event type.ActivityIsEndingException
- if the activity represented by the activity handle
is already ending in the SLEE. Once an Activity Context enters the Ending
state, no further events may be fired on the activity by SBBs or resource
adaptors.FireEventException
- if the SLEE could not accept the event for processing where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the event could not be accepted by the SLEE due to a
system-level failure.void fireEventTransacted(ActivityHandle handle, FireableEventType eventType, Object event, Address address, ReceivableService service) throws NullPointerException, UnrecognizedActivityHandleException, IllegalEventException, TransactionRequiredLocalException, ActivityIsEndingException, FireEventException, SLEEException
The ordering of events fired via this method is self-consistent. Events fired on the same activity by a resource adaptor using this method from a single thread will be processed by the SLEE in the order that they were fired. However, no consistency guarantees are made between events fired from different threads, events fired on different activities, or between an event fired in a non-transacted manner and an event fired in a transacted manner, where both events are fired within the same transaction context.
This method is a mandatory transactional method.
This method is equivalent to
fireEventTransacted(handle, eventType, event, address, service, EventFlags.NO_FLAGS)
.
handle
- the activity handle representing the activity that the event is
being fired on.eventType
- the event type of the event. FireableEventType
objects
can be obtained from the EventLookupFacility
.event
- the event object being fired.address
- the optional default address on which the event is being fired.
May be null
if no default address is specified.service
- the optional service that is the target recipient of the event.
If this argument is not null
, the SLEE will deliver the event
to interested SBBs in the specified service only. If this argument is
null
the event will be delivered to interested SBBs in all
active services. ReceivableService
objects may be obtained
from the ServiceLookupFacility
or from the
service lifecycle callback methods invoke on the resource adaptor object
such as ResourceAdaptor.serviceActive
.NullPointerException
- if handle
or event
is
null
.UnrecognizedActivityHandleException
- if the activity handle is not known by
the SLEE.IllegalEventException
- if the specified event type is not a FireableEventType
object generated by the SLEE and provided to the resource adaptor via an
EventLookupFacility
, if the specified event type
is not an event type that the resource adaptor is permitted to fire (a resource
adaptor may only fire events of event types referenced by the resource adaptor
types it implements unless this restriction has been disabled in the resource
adaptor's deployment descriptor), or if the class of the event object is not
assignable to the event class of the event type.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.ActivityIsEndingException
- if the activity represented by the activity handle
is already ending in the SLEE. Once an Activity Context enters the Ending
state, no further events may be fired on the activity by SBBs or resource
adaptors.FireEventException
- if the SLEE could accept the event for processing where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the event could not be accepted by the SLEE due to a
system-level failure.void fireEventTransacted(ActivityHandle handle, FireableEventType eventType, Object event, Address address, ReceivableService service, int eventFlags) throws NullPointerException, UnrecognizedActivityHandleException, IllegalEventException, TransactionRequiredLocalException, ActivityIsEndingException, FireEventException, SLEEException
The ordering of events fired via this method is self-consistent. Events fired on the same activity by a resource adaptor using this method from a single thread will be processed by the SLEE in the order that they were fired. However, no consistency guarantees are made between events fired from different threads, events fired on different activities, or between an event fired in a non-transacted manner and an event fired in a transacted manner, where both events are fired within the same transaction context.
A resource adaptor object may be notified of the outcome of event processing
by setting the appropriate event flags
in the eventFlags
argument. Event processing success or failure is independent of the commit or
rollback of the transaction that fires the event. If a resource adaptor object
uses this method to fire an event in a transacted manner and requests event
processing callbacks, no callback will be made if the firing transaction rolls
back as the event was never fully accepted for processing by the SLEE. Requested
event processing callbacks will only be made after the firing transaction
successfully commits and the SLEE processess the event.
This method is a mandatory transactional method.
handle
- the activity handle representing the activity that the event is
being fired on.eventType
- the event type of the event. FireableEventType
objects
can be obtained from the EventLookupFacility
.event
- the event object being fired.address
- the optional default address on which the event is being fired.
May be null
if no default address is specified.service
- the optional service that is the target recipient of the event.
If this argument is not null
, the SLEE will deliver the event
to interested SBBs in the specified service only. If this argument is
null
the event will be delivered to interested SBBs in all
active services. ReceivableService
objects may be obtained
from the ServiceLookupFacility
or from the
service lifecycle callback methods invoke on the resource adaptor object
such as ResourceAdaptor.serviceActive
.eventFlags
- the event flags
the event should be fired with.NullPointerException
- if handle
or event
is
null
.UnrecognizedActivityHandleException
- if the activity handle is not known by
the SLEE.IllegalEventException
- if the specified event type is not a FireableEventType
object generated by the SLEE and provided to the resource adaptor via an
EventLookupFacility
, if the specified event type
is not an event type that the resource adaptor is permitted to fire (a resource
adaptor may only fire events of event types referenced by the resource adaptor
types it implements unless this restriction has been disabled in the resource
adaptor's deployment descriptor), or if the class of the event object is not
assignable to the event class of the event type.UnrecognizedServiceException
- if the service
argument is not
null
and does not identify a service in the SLEE that is in the
Active or Stopping state.TransactionRequiredLocalException
- if this method is invoked without a
valid transaction context.ActivityIsEndingException
- if the activity represented by the activity handle
is already ending in the SLEE. Once an Activity Context enters the Ending
state, no further events may be fired on the activity by SBBs or resource
adaptors.FireEventException
- if the SLEE could accept the event for processing where the reason is
not a system level failure (such as input rate-limiting).SLEEException
- if the event could not be accepted by the SLEE due to a
system-level failure.