Java DTV API 1.3
18-Nov-2009

com.sun.dtv.application
Interface ApplicationProxy


public interface ApplicationProxy

Control an Application via the application manager. The Application manager of a device controls the applications running on the device. This interface allows an application with appropriate permissions to monitor running applications, to start an application, and to request changes to the lifecycle of the application.


Field Summary
static int ACTIVE
          The application is active.
static int DESTROYED
          The application has been destroyed.
static int LOADED
          The application has been loaded.
static int NOT_LOADED
          The application is known to the application manager but has not been loaded.
static int PAUSED
          The application has been paused.
 
Method Summary
 void addListener(AppProxyListener listener)
          Adds a listener for changes in the application state.
 int getState()
          Gets the state of the Application.
 void pause()
          Requests the application be paused.
 void removeListener(AppProxyListener listener)
          Remove a listener registered for changes.
 void resume()
          Requests the application be resumed.
 void start(String[] parameters)
          Request the application be ACTIVE with the specified parameters.
 void stop()
          Requests the application to be stopped.
 

Field Detail

ACTIVE

static final int ACTIVE
The application is active. The value is 0.

See Also:
getState(), Xlet states, Constant Field Values

DESTROYED

static final int DESTROYED
The application has been destroyed. The value is 1.

See Also:
getState(), Xlet states, Constant Field Values

LOADED

static final int LOADED
The application has been loaded. The value is 2.

See Also:
getState(), Xlet states, Constant Field Values

PAUSED

static final int PAUSED
The application has been paused. The value is 3.

See Also:
getState(), Xlet states, Constant Field Values

NOT_LOADED

static final int NOT_LOADED
The application is known to the application manager but has not been loaded. The value is 4.

See Also:
getState(), Constant Field Values
Method Detail

start

void start(String[] parameters)
Request the application be ACTIVE with the specified parameters. The number of parameters may be zero or more. The application is requested to be started if it is not already active. If the target application is a Java DTV application the arguments MUST be made available as the javax.microedition.xlet.XletContext.ARGS.

Parameters:
parameters - the array of parameters to be passed to the application; null MUST have the same behavior as passing a zero length array.
Throws:
IllegalStateException - if the application is already ACTIVE

stop

void stop()
Requests the application to be stopped.

Throws:
IllegalStateException - if the application is not ACTIVE

pause

void pause()
Requests the application be paused.

Throws:
IllegalStateException - if the application is not ACTIVE

resume

void resume()
Requests the application be resumed.

Throws:
IllegalStateException - if the application is not PAUSED.

getState

int getState()
Gets the state of the Application.

Returns:
one of LOADED, PAUSED, ACTIVE, DESTROYED, or NOT_LOADED.

addListener

void addListener(AppProxyListener listener)
Adds a listener for changes in the application state.

Parameters:
listener - the listener to add.
See Also:
removeListener(com.sun.dtv.application.AppProxyListener)

removeListener

void removeListener(AppProxyListener listener)
Remove a listener registered for changes. If the listener was not added, no action is taken.

Parameters:
listener - the listener to remove.
See Also:
addListener(com.sun.dtv.application.AppProxyListener)

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.