Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

Copyright © 2006 Sun Microsystems, Inc. All rights reserved.

JSR-927 (Maintenance Release)

javax.tv.service.selection
Class ServiceContextFactory

java.lang.Object
  extended byjavax.tv.service.selection.ServiceContextFactory

public abstract class ServiceContextFactory
extends java.lang.Object

This class serves as a factory for the creation of ServiceContext objects.


Constructor Summary
protected ServiceContextFactory()
          Creates a ServiceContextFactory.
 
Method Summary
abstract  ServiceContext createServiceContext()
          Creates a ServiceContext object.
static ServiceContextFactory getInstance()
          Provides an instance of ServiceContextFactory.
abstract  ServiceContext getServiceContext(XletContext ctx)
          Reports the ServiceContext in which the Xlet corresponding to the specified XletContext is running.
abstract  ServiceContext[] getServiceContexts()
          Provides the ServiceContext instances to which the caller of the method is permitted access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceContextFactory

protected ServiceContextFactory()
Creates a ServiceContextFactory.

Method Detail

getInstance

public static ServiceContextFactory getInstance()
Provides an instance of ServiceContextFactory.

Returns:
An instance of ServiceContextFactory.

createServiceContext

public abstract ServiceContext createServiceContext()
                                             throws InsufficientResourcesException,
                                                    java.lang.SecurityException
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.

Returns:
A new ServiceContext object.
Throws:
InsufficientResourcesException - If the receiver lacks the resources to create this ServiceContext.
java.lang.SecurityException - if the caller doesn't have ServiceContextPermission("create", "own").
See Also:
ServiceContextPermission

getServiceContexts

public abstract ServiceContext[] getServiceContexts()
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.

Returns:
An array of accessible ServiceContext objects.
See Also:
ServiceContextPermission

getServiceContext

public abstract ServiceContext getServiceContext(XletContext ctx)
                                          throws java.lang.SecurityException,
                                                 ServiceContextException
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.

Parameters:
ctx - The XletContext of the Xlet of interest.
Returns:
The ServiceContext in which the Xlet corresponding to ctx is running.
Throws:
java.lang.SecurityException - If the caller does not have ServiceContextPermission("access", "own").
ServiceContextException - If the Xlet corresponding to ctx is not running within a ServiceContext.
See Also:
ServiceContextPermission

JSR-927 (Maintenance Release)

Copyright © 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to License Terms. Your use of this web site or any of its content or software indicates your agreement to be bound by these License Terms.

For more information, please consult the JSR 927 specification.