public interface Xlet
XletContext.In order to support interoperability between Xlets and application managers, all Xlet classes must provide a public no-argument constructor.
Note: the methods on this interface are meant to signal state changes. The state change is not considered complete until the state change method has returned. It is intended that these methods return quickly.
If the methods initXlet(), startXlet(), or
pauseXlet() terminate with an uncaught exception or error,
then the application manager will immediately destroy the Xlet
unconditionally by invoking its destroyXlet() method.
XletContext| Modifier and Type | Method and Description |
|---|---|
void |
destroyXlet(boolean unconditional)
Signals the Xlet to terminate and enter the Destroyed state.
|
void |
initXlet(XletContext ctx)
Signals the Xlet to initialize itself and enter the
Paused state.
|
void |
pauseXlet()
Signals the Xlet to stop providing service and
enter the Paused state.
|
void |
startXlet()
Signals the Xlet to start providing service and
enter the Active state.
|
void initXlet(XletContext ctx) throws XletStateChangeException
An XletContext is used by the Xlet to access
properties associated with its runtime environment.
After this method returns successfully, the Xlet
is in the Paused state and should be quiescent.
If the Xlet cannot initialize, XletStateChangeException
should be thrown. As a result, the application manager will
immediately destroy the Xlet unconditionally by invoking the
destroyXlet() method.
Note: This method shall only be called once.
ctx - The XletContext of this Xlet.XletStateChangeException - If the Xlet cannot be
initialized.XletContextvoid startXlet()
throws XletStateChangeException
XletStateChangeException - is thrown if the Xlet
cannot start providing service.void pauseXlet()
void destroyXlet(boolean unconditional)
throws XletStateChangeException
Xlets should perform any operations required before being terminated, such as releasing resources or saving preferences or state.
NOTE: The Xlet can request that it not enter the Destroyed
state by throwing an XletStateChangeException. This
is only a valid response if the unconditional
flag is set to false. If it is true
the Xlet is assumed to be in the Destroyed state
regardless of how this method terminates. If it is not an
unconditional request, the Xlet can signify that it wishes
to stay in its current state by throwing the Exception.
This request may be honored and the destroyXlet()
method called again at a later time.
unconditional - If unconditional is true when this
method is called, requests by the Xlet to not enter the
destroyed state will be ignored.XletStateChangeException - is thrown if the Xlet
wishes to continue to execute (Not enter the Destroyed
state).
This exception is ignored if unconditional
is equal to true.Copyright © 2012 code4tv.com. All Rights Reserved.