
javax.tv.service.selection.ServiceContextFactory Maven / Gradle / Ivy
/*
* @(#)ServiceContextFactory.java 1.28 00/10/09
*
* Copyright 1998-2000 by Sun Microsystems, Inc.,
* 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
* All rights reserved.
*
* This software is the confidential and proprietary information
* of Sun Microsystems, Inc. ("Confidential Information"). You
* shall not disclose such Confidential Information and shall use
* it only in accordance with the terms of the license agreement
* you entered into with Sun.
*/
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")
.
**/
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.
*
* @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
* Xlet
corresponding to ctx
does not have
* ServiceContextPermission("access", "own")
.
*
* @throws ServiceContextException If the
* Xlet
corresponding to ctx
is not running
* within a ServiceContext
.
*/
public abstract ServiceContext getServiceContext(javax.tv.xlet.XletContext
ctx)
throws SecurityException, ServiceContextException;
}