public class PresentationTerminatedEvent extends ServiceContextEvent
PresentationTerminatedEvent is generated when the presentation
of a service terminates. This includes both normal termination (e.g., due to
an application calling the stop() method) and abnormal
termination (e.g., due to some change in the environment). Examples of
abnormal termination include:
PresentationTerminatedEvent is also generated following a
SelectionFailedEvent either if the service context was not
previously in the presenting state or if recovery of what was
being presented previously is not possible.
PresentationTerminatedEvent is only generated when no
components of the requested service can be presented.
Once this event has been generated, a ServiceContext will be
in the not presenting state until a call to a
select() method succeeds. When this event is generated, all
resources used for the presentation have been released, and
ServiceContentHandler instances presviously associated with
the ServiceContext will have ceased presentation of their
content.
When a call to ServiceContext.select() fails for a service context in the not
presenting state, the following table defines how the reason code for the
PresentationTerminatedEvent shall be derived from the reason code of the
SelectionFailedEvent which first notified applications of the failure of the
method call.
Table A.1: Reason code mapping
SelectionFailedEvent reason code - PresentationTerminatedEvent reason code
CA_REFUSAL- ACCESS_WITHDRAWN
CONTENT_NOT_FOUND- SERVICE_VANISHED
INSUFFICIENT_RESOURCES- RESOURCES_REMOVED
MISSING_HANDLER- RESOURCES_REMOVED
TUNING_FAILURE - TUNED_AWAY
No equivalent of the reason code
SelectionFailedEvent.INTERRUPTED shall be generated for service contexts
formerly in the not_presenting state since by definition, another selection
is in process on the service context concerned. In the definition of the
USER_STOP code, replace "The user" with "An application or the end user.
SelectionFailedEvent,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
ACCESS_WITHDRAWN
Reason code : Access to the service or some component of it has been
withdrawn by the system.
|
static int |
RESOURCES_REMOVED
Reason code : Resources needed to present the service have been removed.
|
static int |
SERVICE_VANISHED
Reason code : The service vanished from the network.
|
static int |
TUNED_AWAY
Reason code : Tuning made the service unavailable.
|
static int |
USER_STOP
Reason code : The user requested that the presentation be stopped.
|
source| Constructor and Description |
|---|
PresentationTerminatedEvent(ServiceContext source,
int reason)
Constructs the event with a reason code.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getReason()
Reports the reason for which the presentation was terminated.
|
getServiceContextgetSource, toStringpublic static final int SERVICE_VANISHED
public static final int TUNED_AWAY
public static final int RESOURCES_REMOVED
public static final int ACCESS_WITHDRAWN
public static final int USER_STOP
public PresentationTerminatedEvent(ServiceContext source, int reason)
source - The ServiceContext that generated the event.reason - The reason for which the presentation was terminated.Copyright © 2012 code4tv.com. All Rights Reserved.