javax.tv.service.selection.ServiceContextFactory Maven / Gradle / Ivy
/**
This is not an official specification document, and usage is restricted.
NOTICE
(c) 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
Neither this file nor any files generated from it describe a complete
specification, and they may only be used as described below.
Sun Microsystems Inc. owns the copyright in this file and it is provided
to you for informative use only. For example,
this file and any files generated from it may be used to generate other documentation,
such as a unified set of documents of API signatures for a platform
that includes technologies expressed as Java APIs.
This file may also be used to produce "compilation stubs,"
which allow applications to be compiled and validated for such platforms.
By contrast, no permission is given for you to incorporate this file,
in whole or in part, in an implementation of a Java specification.
Any work generated from this file, such as unified javadocs or compiled
stub files, must be accompanied by this notice in its entirety.
This work corresponds to the API signatures of JSR 927: Java TV API 1.1.1.
In the event of a discrepency between this work and the JSR 927 specification,
which is available at http://www.jcp.org/en/jsr/detail?id=927, the latter takes precedence.
*/
package javax.tv.service.selection;
/**
* This class serves as a factory for the creation of
*ServiceContext
objects.
*/
public abstract class ServiceContextFactory
{
/**
* Creates a ServiceContextFactory
.
*/
protected ServiceContextFactory() { }
/**
* Provides an instance of ServiceContextFactory
.
*
* @return An instance of ServiceContextFactory
.
*/
public static ServiceContextFactory getInstance() {
return null;
}
/**
* Creates a ServiceContext
object. The new
* ServiceContext
is created in the not
* presenting state.
*
*
Due to resource restrictions,
* implementations may limit the total number of simultaneous
* ServiceContext
objects. In such a case,
* InsufficientResourcesException
is thrown.
*
* @return A new ServiceContext
object.
*
* @throws InsufficientResourcesException If the receiver lacks
* the resources to create this ServiceContext
.
*
* @throws SecurityException if the caller doesn't have
* ServiceContextPermission("create", "own")
.
*
* @see ServiceContextPermission
*/
public abstract ServiceContext createServiceContext()
throws InsufficientResourcesException, SecurityException;
/**
* Provides the ServiceContext
instances to which the
* caller of the method is permitted access. If the caller has
* ServiceContextPermission("access","*")
, then all
* current (i.e., undestroyed) ServiceContext
instances
* are returned. If the application making this call is running in
* a ServiceContext
and has
* ServiceContextPermission("access","own")
, its own
* ServiceContext
will be included in the returned
* array. If no ServiceContext
instances are
* accessible to the caller, a zero-length array is returned. No
* ServiceContext
instances in the destroyed
* state are returned by this method.
*
* @return An array of accessible ServiceContext
objects.
*
* @see ServiceContextPermission
*/
public abstract ServiceContext[] getServiceContexts();
/**
* Reports the ServiceContext
in which the
* Xlet
corresponding to the specified
* XletContext
is running. The returned
* ServiceContext
is the one from which the
* Service
carrying the Xlet
was selected,
* and is the Xlet's "primary" ServiceContext
.
*
* @param ctx The XletContext
of the Xlet
* of interest.
*
* @return The ServiceContext
in which the Xlet
* corresponding to ctx
is running.
*
* @throws SecurityException If the caller does not have
* ServiceContextPermission("access", "own")
.
*
* @throws ServiceContextException If the
* Xlet
corresponding to ctx
is not running
* within a ServiceContext
.
*
* @see ServiceContextPermission
*/
public abstract ServiceContext getServiceContext(javax.tv.xlet.XletContext
ctx) throws SecurityException, ServiceContextException;
}