Java DTV API 1.3
18-Nov-2009

com.sun.dtv.application
Interface Application


public interface Application

Get attributes of an Application. For each application the attributes can be queried including the appId, type, the application name in one or more locales, the priority and visibility, the service, version information, and icon.

See Also:
AppManager

Field Summary
static int APP_IXC_SCOPE_SECURED
          Global scope for inter-xlet communication.
static int APP_IXC_SCOPE_UNSECURED
          Unsecured scope for inter-xlet communication.
static int APP_TYPE_HTML
          Application type for an HTML application.
static int APP_TYPE_JAVA
          Application type for Java DTV application.
static int APP_TYPE_NCL
          Application type for NCL.
static int APP_TYPE_RESIDENT
          Application type for native or resident applications.
 
Method Summary
 String getAppId()
          Gets the appId as a string.
 int getIconFlags()
          Gets the flags that describe the available sizes of the icons.
 Locator getIconLocator()
          Gets the locator for the Icon.
 String getIxcFullyQualifiedName(String name, int scope)
          Generates a fully qualified reference to the object name in the given application namespace for the purpose of inter-xlet communication (IXC) within a given scope.
 String getName()
          Gets the name of the application in the default locale.
 String getName(String locale)
          Gets the name of the application in the requested locale.
 String[] getNameLocales()
          Gets the locales for which the application has locale specific names.
 int getPriority()
          Gets the priority of the application.
 String[] getProfiles()
          Gets the application profiles required to run this application.
 Service getService()
          Gets the Service of this application.
 int getType()
          Gets the application type.
 short[] getVersion(String appProfile)
          Gets the version number of the application in the requested profile.
 boolean isServiceBound()
          Gets the binding of the Application to the service context.
 boolean isStartable()
          Gets the startable flag for the application.
 boolean isVisible()
          Gets the visibility of the application to users.
 

Field Detail

APP_TYPE_JAVA

static final int APP_TYPE_JAVA
Application type for Java DTV application. The value is 1 as defined by ABNT NBR 15606-3:2007 Table 45.

See Also:
Constant Field Values

APP_TYPE_HTML

static final int APP_TYPE_HTML
Application type for an HTML application. The value is 2 as defined by ABNT NBR 15606-3:2007 Table 45.

See Also:
Constant Field Values

APP_TYPE_NCL

static final int APP_TYPE_NCL
Application type for NCL. The value is 9 as defined by ABNT NBR 15606-3:2007 Table 45.

See Also:
Constant Field Values

APP_TYPE_RESIDENT

static final int APP_TYPE_RESIDENT
Application type for native or resident applications. The value is 32768.

See Also:
Constant Field Values

APP_IXC_SCOPE_SECURED

static final int APP_IXC_SCOPE_SECURED
Global scope for inter-xlet communication. In this scope, inter-xlet communication is restricted to same class applications: signed applications can only share objects with other signed applications and unsigned applications can only share objects with other unsigned applications.

See Also:
getIxcFullyQualifiedName(java.lang.String, int), Constant Field Values

APP_IXC_SCOPE_UNSECURED

static final int APP_IXC_SCOPE_UNSECURED
Unsecured scope for inter-xlet communication. It allows application to communicate with any other application: that includes also signed application communicating with unsigned applications.

See Also:
getIxcFullyQualifiedName(java.lang.String, int), Constant Field Values
Method Detail

getIconLocator

Locator getIconLocator()
Gets the locator for the Icon.

Returns:
the Locator for the Icons.

getIconFlags

int getIconFlags()
Gets the flags that describe the available sizes of the icons.

Returns:
an int with flags for each available icon size. Refer to ABNT NBR 15606-3:2007 Table 54 for Icon flag bits.

getAppId

String getAppId()
Gets the appId as a string.

Returns:
the application identifier as a string.
See Also:
AppManager.makeApplicationId(int, int)

isStartable

boolean isStartable()
Gets the startable flag for the application.

Returns:
true if the application can be started; otherwise false.

isServiceBound

boolean isServiceBound()
Gets the binding of the Application to the service context.

Returns:
true if the application is bound to the service; otherwise false.

getProfiles

String[] getProfiles()
Gets the application profiles required to run this application.

Returns:
an array of the profiles required by this application; returns a zero length array if there are none.

getVersion

short[] getVersion(String appProfile)
Gets the version number of the application in the requested profile.

Parameters:
appProfile - the profile for which to get the application's version.
Returns:
a 3 element array containing the major, minor, and micro version numbers.

getService

Service getService()
Gets the Service of this application. The Service is the service from which the application was retrieved.

Returns:
the Service this application is part of; may be null.

getName

String getName()
Gets the name of the application in the default locale.

Returns:
the name of the application in the default locale.

getName

String getName(String locale)
Gets the name of the application in the requested locale.

Parameters:
locale - the locale for which to get the application name.
Returns:
the application name in the requested locale; null if it is not available.

getNameLocales

String[] getNameLocales()
Gets the locales for which the application has locale specific names.

Returns:
an array of the locales for which the application has localized names; a zero length array is returned if there are none.

getPriority

int getPriority()
Gets the priority of the application.

Returns:
the priority of the application; the value is greater than or equal to zero and less than or equal to 255.

isVisible

boolean isVisible()
Gets the visibility of the application to users.

Returns:
the visibility of the application; true if the application is visible to the user; false otherwise.

getType

int getType()
Gets the application type.

Returns:
the application type; one of APP_TYPE_JAVA, APP_TYPE_NCL, APP_TYPE_RESIDENT, or ABNT NBR 15606-3:2007 Table 45 Application Types.

getIxcFullyQualifiedName

String getIxcFullyQualifiedName(String name,
                                int scope)
                                throws NullPointerException,
                                       IllegalArgumentException,
                                       IllegalStateException
Generates a fully qualified reference to the object name in the given application namespace for the purpose of inter-xlet communication (IXC) within a given scope. Refer to the Inter-Application Communication section for more details. This reference may then be used as argument when calling any methods of the IxcRegistry class.

Depending on the value of scope, the implementation will generate the corresponding resource locator:

where appId is the value conform to the value returned by getAppId()

An application wishing to build a reference to an object belonging to another application may proceed as follows:

 String appid = ... the application to communicate with;
 String fqn = AppManager
              .getAppManager()
              .getApplication(appid)
              .getIxcFullyQualifiedName("obj", APP_IXC_SCOPE_SECURED);

 ... now lets communicate
 IxcRegistry ixc = IxcRegistry.getRegistry(xletContext);
 ixc.bind(fqn, obj); 
 

Parameters:
scope - Any of the APP_IXC_SCOPE_ constants defined by this interface.
name - The name identifying the object and that is to be shared.
Returns:
The fully qualified IXC reference to name.
Throws:
NullPointerException - If name is null.
IllegalArgumentException - If scope is none of the constants starting with APP_IXC_SCOPE_ defined by this interface.
IllegalStateException - If scope is set to APP_IXC_SCOPE_SECURED although the application is not signed (or verified as such).
See Also:
IxcRegistry

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.