|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScarceResourceListener
Listener to be notified about release status of a given scarce resource.
When calling any methods of this interface, certain platforms may define a timespan until when those methods are expected to return. If they do not return within that timeframe, the implementation must behave as if the method returned. This mechanism allows to avoid that applications block those methods unnecessarily.
Method Summary | |
---|---|
void |
released(ScarceResource resource)
Reports that resource has been released by the
implementation and is available for a new reservation. |
void |
releaseForced(ScarceResource resource)
Reports that resource is being aggressively requested
by another application and gives the current owner the chance to
close his task. |
boolean |
releaseRequested(ScarceResource resource)
Reports that resource is being requested by another
application. |
Method Detail |
---|
boolean releaseRequested(ScarceResource resource)
resource
is being requested by another
application. The current owner is free to decide whether it can
and want to release that given resource to its competitor.
If this method returns false
, the implementation
understands that the current owner wants to keep the resource and
that it is therefore not available to the competitor.
On the other hand, returning true
tells the platform
that the current owner is ready to release its resource. In this case
the implementation must release itself
the given resource. This in turn will trigger a released
event on this interface.
When supported, in case where this method does not return within
a given timeframe, the implementation must
behave as if the method returned true
.
resource
- The instance of the scarce resource that is requested
to be released.
void releaseForced(ScarceResource resource)
resource
is being aggressively requested
by another application and gives the current owner the chance to
close his task. On return of this call, the implementation
must release this resource. This in
turn will trigger a released
event on this interface.
resource
- The instance of the scarce resource that is required
to be released.void released(ScarceResource resource)
resource
has been released by the
implementation and is available for a new reservation. This method
is called by the implementation subsequently to a
ScarceResource.release()
or after the
releaseForced()
or releaseRequested()
events.
When the implementation calls this method, the object will have been
invalidated, i.e. the application that owned this resource is no more
able to interact with the given resource: calls are ignored and
methods may throw an
IllegalStateException
.
resource
- The instance of the scarce resource that has been
released.
|
Java DTV API 1.3 18-Nov-2009 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |