public class AppStateChangeEvent extends EventObject
AppStateChangeEvent
class indicates a state transition of
the application.
These events are only generated for running applications or for non-running applications
where an attempt to control the application fails.
If the state transition was requested by an application
through this API, the method hasFailed
indicates whether
the state change failed or not. Where a state change succeeds, fromState
and toState
shall indicate the original and destination state of the
transition.
If it failed, fromState
shall return
the state the application was in before the state transition was requested and
the toState
method shall return the state the application would have
been in if the state transition had succeeded.
Attempting to start an application which is already in the active state shall fail
and generate an AppStateChangeEvent
with hasFailed
returning true and both fromstate and tostate being STARTED
.
source
Constructor and Description |
---|
AppStateChangeEvent(AppID appid,
int fromstate,
int tostate,
Object source,
boolean hasFailed)
Create an AppStateChangeEvent object.
|
Modifier and Type | Method and Description |
---|---|
AppID |
getAppID()
The application the listener was tracking has made a state
transition from
fromState to toState . |
int |
getFromState()
The application the listener is tracking was in
fromState ,
where the value of fromState is one of the state values defined in
the AppProxy interface or in the interfaces inheriting from it. |
int |
getToState()
If the
hasFailed method returns false, then the application the listener is
tracking is now in toState . |
boolean |
hasFailed()
This method determines whether an attempt to change the state of an application
has failed.
|
getSource, toString
public AppStateChangeEvent(AppID appid, int fromstate, int tostate, Object source, boolean hasFailed)
appid
- a registry entry representing the tracked applicationfromstate
- the state the application was in before the state transition was requested, where the value of fromState is one of the state values defined in
the AppProxy interface or in the interfaces inheriting from ittostate
- state the application would be in if the state transition succeeds, where the value of toState is one of the state values defined in
the AppProxy interface or in the interfaces inheriting from ithasFailed
- an indication of whether the transition failed (true) or succeeded (false)source
- the AppProxy
where the state transition happenedpublic AppID getAppID()
fromState
to toState
.
public int getFromState()
fromState
,
where the value of fromState is one of the state values defined in
the AppProxy interface or in the interfaces inheriting from it.public int getToState()
hasFailed
method returns false, then the application the listener is
tracking is now in toState
. If the hasFailed
method returns
true, then the toState
is the state
where the state transition was attempted to but the transition failed. The value of
toState
is one of the state values defined in the AppProxy
interface or in the interfaces inheriting from it.public boolean hasFailed()
Copyright © 2013 CableLabs. All rights reserved.