|
Copyright 2008 Motorola Inc. and Nokia Corporation. All Rights Reserved. Specification License |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.microedition.broadcast.ServiceContext
public abstract class ServiceContext
The ServiceContext
class abstracts the concept of
a broadcast receiver. It provides these functionalities:
ServiceContext
can be in one of the six states -
STOPPED
,
ACQUIRING_SERVICE
,
SERVICE_ACQUIRED
,
PREPARING_MEDIA
,
PRESENTING
,
CLOSED
.
State transition is depicted in the following diagram.
STOPPED
state caused by a call to stop()
method is allowed
before all the listeners complete with the COMPONENT_IDENTIFIED
event.
Some ServiceContext
methods throw IllegalStateException
if
ServiceContext
is not in a valid state.
In those cases IllegalStateException
is thrown
before any other Exception
s would be thrown. For instance,
in STOPPED
state getPlayer(null)
will
throw IllegalStateException
instead of NullPointerException
.
ServiceContext
has no selected service
and has nothing to present. If a service was presented prior to
entering this state, its presentation shall be stopped and all
the Player
s created for the presentation shall be closed.
select(Service)
; or a selection initiated
by the underlying receiver implementation for reasons such as
the end of a free preview period. In this state, the receiver performs
a series of tasks to get ready to access the service. That includes
obtaining the service's configurations and identifying its list of
service components.
Upon entering this state, the presentation of the previous service,
if any, is stopped.
If the acquisition process fails, the ServiceContext
is moved to the STOPPED
state, regardless of its previous state.
COMPONENTS_IDENTIFIED
event is delivered with a list of service components selected
for presentation by default. The listeners can override this default
selection by invoking setComponents(ServiceComponent[])
before the actual presentation begins. This change only applies to
the current service and will not affect the system's defaults.
For more details on the default components selection, see
Default Components Selection.
There may be some special cases when there is no component that can be presented in a selected service. In these cases, no component will be selected.
ServiceContext
will be blocked in the SERVICE_ACQUIRED
state until all of the listeners had completed the processings and returned
before transitioning to the PREPARING_MEDIA state.
Player
s
to present selected service components.
Player
s previously used for presenting
other services shall be reconfigured and reused if possible.
New Player
s may be created only if necessary.
The receiver shall make a best attempt at reusing Player
s to avoid
any artifacts (e.g. video flickering) introduced by switching the
Player
s when changing services.
Upon entering this state, COMPONENTS_SET
event is delivered with a relevant reason code, and
getSelectedComponents()
may be invoked to obtain a list
of ServiceComponent
s set for presentation.
Later when any new Player
is created, and other Player
s
become ready to present the components,
PLAYERS_REALIZED
event
is delivered with a list of newly created
Player
s. Those Player
s are in the REALIZED
state. The application selecting the current service should
initialize and configure the Player
s.
That includes for example the steps to prepare the UI for the media
presentation. After all the listeners get notified
of the event, completed their
processings and returned,
the
Player
s are automatically started by ServiceContext
.
Players
that are not created but are reconfigured
for the presentation of new components are also started during this phase.
getPlayer(ServiceComponent)
and getPlayers()
methods
may be invoked upon the delivery of PLAYERS_REALIZED event and afterward.
They can be used to query the association between ServiceComponent
s
and Player
s.
As a special case, there may be no component set for presentation.
Even in that case, ServiceContext
shall move to PRESENTING
state.
There are occasions when there are not enough resources to present
the selected components. Then ServiceContext
is
moved to the STOPPED
state, regardless of its previous state.
Player
s configured in PREPARING_MEDIA state
are actually started. Upon entering this state,
a PRESENTATION_STARTED
event is delivered.
Note that even when a service is being presented successfully,
the presentation may be stopped inadvertently. When this happens,
ServiceContext
will move to the STOPPED
state.
This includes the cases when the required resources are reclaimed
for some reason.
close()
. Any method called on a closed
ServiceContext
except getState()
shall throw an IllegalStateException
.
Before closing a ServiceContext
, an underlying implementation
may retain some resources either for caching or implementation-specific
purposes. Those resources are guaranteed to be released upon entering
the CLOSED state. ServiceContextListener.CONTEXT_CLOSED
is delivered when ServiceContext
is entering this state.
After that ServiceContext
removes all listeners from itself.
PlatformProvider
changes, it stops the
ServiceContext
, transitions it to the STOPPED
state and CONTEXT_STOPPED
event
with reason code REASON_SERVICE_UNAVAILABLE
is posted to ServiceContextListener
s,
unless the ServiceContext
is already in the
CLOSED
or STOPPED
states.
ServiceContext
instance automatically
created by the underlying implementation. This is the default instance
that is shared by all the applications running on a broadcast receiver.
A device may also support a system-level native ESG and channel navigator
application. Any activity on the native application may also affect
the default ServiceContext
; such as the user using the native
application to change the current service.
The default instance is thus used to affect the current user selection
of service. For instance, an application bound to a preview channel
for paid channels may want to switch the current service on user's
selection. To avoid affecting the current user selection,
an application should create new instances of ServiceContext
if it need to select services
without changing the current user selection. For example, a broadcast
receiver may be capable of playing back two video services simultaneously.
In that case, a secondary video may be controlled by another
ServiceContext
.
ServiceContext
s,
if it has the required permissions and there are enough resources
such as memory space to create the instances. However the resources required
for the presentation of a service are not reserved at the time of creation.
Therefore in some cases, a service selection may fail if any
of the required resources are not available.
A presenting service may also be stopped when any of the resources
in use are withdrawn by the receiver implementation or other applications.
The details of the resource allocation schemes are implementation-dependent.
When this happens, the service selection will succeed resulting in
a SELECTION_INITIATED
event. But since the content was substituted, in this case, a second
SELECTION_INITIATED
event will be sent. The event's reasons
code will be set to REASON_ALTERNATIVE_CONTENT
.
ServiceContext
exclusively creates and manages
the Player
s for presenting the media.
If a selected service contains video components, the corresponding
Player
s are created and set to the REALIZED
state. When the ServiceContextListener.PLAYERS_REALIZED
event is delivered, the application may access
those Player
s.
Then it can fetch VideoControl
from the Player
and set up the UI necessary to present the video. Note that
the presentation of audio and video components
sharing a common time base shall be represented as one single
Player
.
Once a Player
is created, it is reused whenever possible.
In PREPARING_MEDIA state, ServiceContext
first checks whether there is any unclosed Player
, which was
previously used to present media of the same configuration.
That is, a Player
for presenting a audio
may not be reconfigured for presenting a video, and vice versa.
After reconfiguring some Player
s, remaining ones are closed,
and new ones are created if some service components cannot be presented
by reconfiguring existing ones.
The Player
s are closed when the corresponding
ServiceContext
is closed, they remain unused
after the above mentioned reconfiguration, or when an application closes
the Player
s explicitly by invoking Player.close()
.
Explicit closing of Player
s is required when
new Player
instances must be created to perform some
configurations such as invoking
javax.microedition.media.control.VideoControl#initDisplayMode(int,
Object)
, which is permitted to be invoked only once during the lifespan
of a Player
.
ServiceComponents
with type
ServiceComponent.FILECAST
. Filecast contents may not
be presented with a Player
. They are generally
read as raw data via a BroadcastDatagramConnection
.
Filecast components along with other types of components can be
retrieved with the getAllComponents()
method.
The BroadcastDatagramConnection
associated with
each filecast component can be obtained from the
getBroadcastDatagramConnection(ServiceComponent)
method.
ServiceComponent
objects. They may be obtained by calling
getAllComponents()
after COMPONENTS_IDENTIFIED
event is received.
Note that the components are also accessible within the registered
listeners when the event is delivered.
During the presentation of a service, new components may be added
for presentation; and others may be removed or replaced. Such controls
are all done via setComponents(ServiceComponent[])
.
In this way, it is possible for instance to turn on and off a subtitle
of a specific language.
When a set of components are selected in the course of a service selection,
setComponents(ServiceComponent[])
is called, or
a component change is initiated for other reasons,
COMPONENTS_SET
is delivered.
For filecast components, it is not necessary to call setComponents
to select them for accessing the raw content. The
getBroadcastDatagramConnection
method
can be called directly to obtain the connection which can be used to
access the contents. Calling setComponents
on a filecast
component may or may not fail depending on whether the implementation
can present the filecast content with a Player
, i.e.,
the filecast content may contain custom data type that the
implementation can handle as time-based media.
ServiceContext
implementation
will choose one default component based on the preference set
in the receiver using setPreference(String,Object)
.
For example, a service may contain more than one
audio tracks, each of which is recorded in a different language.
In that case, only one of these audio tracks is selected.
The selection of default components is basically implementation-specific.
It may differ from one broadcast technology to another,
from one broadcaster to another, or from one receiver to another.
Therefore JSR 272 does not define a standard policy for it.
But every implementation of ServiceContext
must
respect at least, one standard preference, LANGUAGE
.
In addition to that, implementation-specific preferences may be defined
and respected by some implementations.
In evaluating preferences set to a ServiceContext
against components contained in a selected service,
there may be occasions where no components are fully compliant with
the current preferences. For example, the system preference may be set
to a particular language. But that language may not be available at all
in a service. In that case, the ServiceContext
implementation must still select at least one available component rather
than picking nothing.
An application may affect the default selection when
COMPONENTS_IDENTIFIED
is received.
The event is delivered with an array of ServiceComponent
containing a list of components selected for presentation.
An application may invoke setComponents(ServiceComponent[])
within the listeners to affect the initial choice of components
used in a selected service.
ServiceContext
instance
to affect its behavior. For example, LANGUAGE
preference
may be set to affect the choice of the default components based on
the language associated with each component. The LANGUAGE
preference is mandatory, and every implementation should respect
it when selecting default components from a selected service.
Note that implementations may add additional preferences and respect
them. The list of all the recognized preference keys can be obtained
via getAllPreferenceKeys()
.
ServiceContext
does not entail launching of Java
applications. There may be plenty of policies in launching and managing
Java applications that have the same lifespan as services or programs.
So JSR 272 assumes that such functionality may be implemented, for example,
by ESG using various mechanisms such as JSR 211 content handler API
by associating a BroadcastConnection
with a content handler.
See Appendix A for more details.
See ServiceContext examples for some usage examples.
Field Summary | |
---|---|
static int |
ACQUIRING_SERVICE
A constant indicating that ServiceContext is in the
ACQUIRING_SERVICE state. |
static int |
CLOSED
A constant indicating that ServiceContext is in the
CLOSED state. |
static java.lang.String |
LANGUAGE
The preferred language of choice. |
static int |
PREPARING_MEDIA
A constant indicating that ServiceContext is in the
PREPARING_MEDIA state. |
static int |
PRESENTING
A constant indicating that ServiceContext is in the
PRESENTING state. |
static int |
SERVICE_ACQUIRED
A constant indicating that ServiceContext is in the
SERVICE_ACQUIRED state. |
static int |
STOPPED
A constant indicating that ServiceContext is in the
STOPPED state. |
Constructor Summary | |
---|---|
ServiceContext()
|
Method Summary | |
---|---|
abstract void |
addListener(ServiceContextListener listener)
Adds a ServiceContextListener to monitor changes
in this context. |
abstract void |
close()
Closes this current instance of ServiceContext . |
static ServiceContext |
createServiceContext()
Creates a new instance of ServiceContext . |
abstract ServiceComponent[] |
getAllComponents()
Returns all the ServiceComponent s available within
the current service. |
abstract java.lang.String[] |
getAllPreferenceKeys()
Returns the list of all the preference keys recognized by this ServiceContext . |
abstract BroadcastDatagramConnection |
getBroadcastDatagramConnection(ServiceComponent component)
Returns a BroadcastDatagramConnection corresponding
to the given ServiceComponent . |
static ServiceContext |
getDefaultContext()
Returns the default ServiceContext instance. |
abstract javax.microedition.media.Player |
getPlayer(ServiceComponent component)
Returns a Player corresponding to the given
ServiceComponent that is currently being presented. |
abstract javax.microedition.media.Player[] |
getPlayers()
Returns all the Player s that control the presentation
of the selected media components of the current service. |
abstract java.lang.Object |
getPreference(java.lang.String key)
Returns a value set for the given preference key. |
abstract ServiceComponent[] |
getSelectedComponents()
Returns all the ServiceComponent s selected for presentation. |
abstract Service |
getService()
Returns the current Service . |
abstract int |
getSignalQuality()
Returns the signal quality of the received transmission. |
abstract int |
getState()
Returns the current state of this ServiceContext object. |
abstract ServiceComponent[] |
getUnrecognizedComponents()
Returns all the ServiceComponent s that contains media
types the system does not support. |
abstract ServiceComponent[] |
getUnselectedComponents()
Returns all the ServiceComponent s that are currently
not selected for presentation but are presentable. |
abstract void |
removeListener(ServiceContextListener listener)
Removes a ServiceContextListener . |
abstract void |
select(Service service)
Selects a service represented by the given Service object. |
abstract void |
setComponents(ServiceComponent[] components)
Sets components to be presented in the context of the current service. |
abstract java.lang.Object |
setPreference(java.lang.String key,
java.lang.Object value)
Sets a preference that can affect the service selection. |
abstract void |
stop()
Stops the presentation of the current service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ACQUIRING_SERVICE
ServiceContext
is in the
ACQUIRING_SERVICE state.
See State Model for more details.
getState()
,
Constant Field Valuespublic static final int CLOSED
ServiceContext
is in the
CLOSED state.
See State Model for more details.
getState()
,
Constant Field Valuespublic static final java.lang.String LANGUAGE
ServiceContext
implementation must respect the
setting of this preference. It may affect the selection
of, for example, the default audio track when more than one
audio tracks are available in various languages. The value shall
be a language tag defined in RFC 3066.
setPreference(String,Object)
,
Constant Field Valuespublic static final int PREPARING_MEDIA
ServiceContext
is in the
PREPARING_MEDIA state.
See State Model for more details.
getState()
,
Constant Field Valuespublic static final int PRESENTING
ServiceContext
is in the
PRESENTING state.
See State Model for more details.
getState()
,
Constant Field Valuespublic static final int SERVICE_ACQUIRED
ServiceContext
is in the
SERVICE_ACQUIRED state.
See State Model for more details.
getState()
,
Constant Field Valuespublic static final int STOPPED
ServiceContext
is in the
STOPPED state.
See State Model for more details.
getState()
,
Constant Field ValuesConstructor Detail |
---|
public ServiceContext()
Method Detail |
---|
public abstract void addListener(ServiceContextListener listener) throws java.lang.IllegalStateException
ServiceContextListener
to monitor changes
in this context.
listener
- The listener to add. If null
is given
or the same listener object is added more than once, it is silently
ignored
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract void close() throws java.lang.SecurityException
ServiceContext
.
Applications must not invoke methods on a closed instance.
If any other method than this is invoked, an IllegalStateException
shall be thrown.
If this method is called on a closed ServiceContext
the request is ignored.
java.lang.SecurityException
- Thrown when this method is called
on the default context returned from getDefaultContext()
method. It is not allowed for applications to close the default
contextpublic static ServiceContext createServiceContext() throws java.lang.SecurityException
ServiceContext
.
ServiceContext
instance
java.lang.SecurityException
- Thrown when the calling application has
no permission to call this method.public abstract ServiceComponent[] getAllComponents() throws java.lang.IllegalStateException
ServiceComponent
s available within
the current service.
ServiceContext
is not in one of SERVICE_ACQUIRED
,
PREPARING_MEDIA
, and PRESENTING
states, an array
of zero-length is returned
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closed or stopped.public abstract java.lang.String[] getAllPreferenceKeys() throws java.lang.IllegalStateException
ServiceContext
.
LANGUAGE
must be supported by all implementations of ServiceContext
,
the returned list must contain at least the LANGUAGE
key.
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract BroadcastDatagramConnection getBroadcastDatagramConnection(ServiceComponent component) throws BroadcastServiceException, java.lang.SecurityException, java.lang.IllegalStateException, java.lang.NullPointerException
BroadcastDatagramConnection
corresponding
to the given ServiceComponent
. The
BroadcastDatagramConnection
returned can be used
to access the raw data from the service component.
There are two cases when the broadcast object cannot be returned for a service component:
SecurityException
will be thrown.
BroadcastServiceException
will be thrown.
component
- service component whose data stream is wanted .
BroadcastDatagramConnection
InsufficientResourcesException
- Thrown if there was not enough
resource to retrieve the designate BroadcastConnection
java.lang.SecurityException
- if access to the content is not allowed.
BroadcastServiceException
- Thrown if the given component is
not an appropriate component, That is, it is not a component
of the currently selected service, or the underlying implementation
is not capable of providing the raw data from the given service
component
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closed or stopped.
If conditions to throw this exception are met it is thrown instead
of any other possible exception.
java.lang.NullPointerException
- Thrown the given component
argument is null
public static ServiceContext getDefaultContext() throws java.lang.SecurityException
ServiceContext
instance.
The default instance is automatically created by underlying
implementation, and shared among all applications.
It reflects the current service selection by user.
Thus, ESG and/or channel navigator application, regardless
of whether they are native or not, effectively behave as if
they select current service via the default instance.
Note that the default context can't be closed by applications.
If close()
is called on it, it throws
a SecurityException
.
ServiceContext
instance
java.lang.SecurityException
- Thrown when the calling application
has no permission to call this method.public abstract javax.microedition.media.Player getPlayer(ServiceComponent component) throws BroadcastServiceException, java.lang.IllegalStateException, java.lang.NullPointerException
Player
corresponding to the given
ServiceComponent
that is currently being presented.
This method returns a valid result only when it is in
PRESENTING
state, or upon delivery of
ServiceContextListener.PLAYERS_REALIZED
event and afterward
if this context is in PREPARING_MEDIA
state.
In all the other states, this method throws
IllegalStateException
.
Note that during the duration of the service, the Player
returned may be closed if it is not reconfigured
for presentation. Any closed Player
will also be notified
via MMAPI's PlayerListener.CLOSED
event.
And the state of the returned Player
s
may be changed by invoking methods such as stop
and
start
on them. Player
s are configured
by ServiceContext
only at the points designated
to do so in this specification. Once configured, they can be
manipulated as designated by MMAPI specification.
Also, any changes on the Player
s do not
affect state of the corresponding ServiceContext
.
component
- A service component being presented.
Player
corresponding to the given service component.
BroadcastServiceException
- Thrown when the specified
component is invalid or unrecognized by the receiver
java.lang.NullPointerException
- when the given component
argument is null
java.lang.IllegalStateException
- Thrown if the ServiceContext
is in PREPARING_MEDIA
and PLAYERS_REALIZED
has not been delivered, or if it is in a state other than
the PREPARING_MEDIA
and PRESENTING
states.
If conditions to throw this exception are met it is thrown instead
of any other possible exception.getPlayers()
public abstract javax.microedition.media.Player[] getPlayers() throws java.lang.IllegalStateException
Player
s that control the presentation
of the selected media components of the current service.
This method returns a valid result if this context is
in the PRESENTING
state; or
in the PREPARING_MEDIA
state upon delivery
of the ServiceContextListener.PLAYERS_REALIZED
event.
In all the other states, this method throws
IllegalStateException
.
Note that the state of the returned Player
s
may be changed by invoking methods such as stop
and
start
on them. Player
s are configured
by ServiceContext
only at the points designated
in this specification. Once configured, they can be
manipulated by using the MMAPI functions.
Changes on the Player
s do not
affect the state of the corresponding ServiceContext
.
Player
s for the selected service content
java.lang.IllegalStateException
- Thrown if the ServiceContext
is in PREPARING_MEDIA
and PLAYERS_REALIZED
has not been delivered, or if it is in a state other than
the PREPARING_MEDIA
and PRESENTING
states.public abstract java.lang.Object getPreference(java.lang.String key) throws java.lang.IllegalStateException, java.lang.NullPointerException
key
- The preference key.
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closed.
If conditions to throw this exception are met it is thrown instead
of any other possible exception.
java.lang.NullPointerException
- Thrown when the given key
is null
public abstract ServiceComponent[] getSelectedComponents() throws java.lang.IllegalStateException
ServiceComponent
s selected for presentation.
ServiceContext
is not in one of SERVICE_ACQUIRED
, PREPARING_MEDIA
,
PRESENTING
states, an array of zero-length is returned
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract Service getService() throws java.lang.IllegalStateException
Service
.
Service
if the
ServiceContext
is not in STOPPED
or CLOSED
state. Otherwise returns null
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract int getSignalQuality() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if this ServiceContext
is in STOPPED
or CLOSED
statepublic abstract int getState()
ServiceContext
object.
ServiceContext
in one of
the states: STOPPED
, ACQUIRING_SERVICE
,
SERVICE_ACQUIRED
, PREPARING_MEDIA
,
PRESENTING
, CLOSED
public abstract ServiceComponent[] getUnrecognizedComponents() throws java.lang.IllegalStateException
ServiceComponent
s that contains media
types the system does not support.
ServiceComponent
s that contains
media types the system cannot present.
When the ServiceContext
is not in one
of SERVICE_ACQUIRED
, PREPARING_MEDIA
,
PRESENTING
states, an array of zero-length is returned
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract ServiceComponent[] getUnselectedComponents() throws java.lang.IllegalStateException
ServiceComponent
s that are currently
not selected for presentation but are presentable. i.e. it
excludes the ones that are not supported by the system
(returned by getUnrecognizedComponents()
).
ServiceComponent
s not selected for presentation.
When the ServiceContext
is not in one
of SERVICE_ACQUIRED
, PREPARING_MEDIA
,
PRESENTING
states, an array of zero-length is returned
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract void removeListener(ServiceContextListener listener) throws java.lang.IllegalStateException
ServiceContextListener
. If the given listener
is not registered previously, it is silently ignored.
listener
- The listener to remove. If null
is given or
if the given listener is already removed,
this method is silently ignored
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closedpublic abstract void select(Service service) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.IllegalStateException, java.lang.NullPointerException
Service
object.
This method returns immediately. A series of events will be
notified via ServiceContextListener
.
See State Model for more details.
Change of components initiated by a call to this method will
make COMPONENTS_SET
event to have the
reason code REASON_APPLICATION_REQUESTED
.
If there is any service being presented in this
ServiceContext
, it will be completely replaced
by the new service designated. And as a special case, if the current
service is selected repeatedly, the request is silently ignored.
service
- The Service
to select.
java.lang.IllegalArgumentException
- Thrown if the given service
is from a PlatformProvider
other than the current selection
to the PlatformProviderSelector
java.lang.SecurityException
- Thrown when the calling application has
no permission to call this method.
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closed.
If conditions to throw this exception are met it is thrown instead
of any other possible exception.
java.lang.NullPointerException
- Thrown if the given argument is
null
public abstract void setComponents(ServiceComponent[] components) throws InsufficientResourcesException, java.lang.IllegalStateException, BroadcastServiceException, java.lang.NullPointerException
COMPONENTS_SET
event isn't necessarily
posted immediately after call to this method.
However, getSelectedComponents()
will return components
set in this method after the method call has returned.
components
- list of components to be set. If an array
of zero length is specified, it means presenting nothing
InsufficientResourcesException
- Thrown when it is impossible
to present the given set of service components because of insufficient
resources.
BroadcastServiceException
- Thrown when the specified list
of components cannot be all presented. Such cases
include when more than one audio are specified in the receiver
capable of rendering only one audio at a time, or some components
are not supported and cannot be presented by the receiver, or the
components are not available for some reasons.
java.lang.IllegalStateException
- Thrown if the ServiceContext
is not in SERVICE_ACQUIRED
or PRESENTING
state.
If conditions to throw this exception are met it is thrown instead
of any other possible exception.
java.lang.NullPointerException
- Thrown when the given argument is
null
public abstract java.lang.Object setPreference(java.lang.String key, java.lang.Object value) throws java.lang.IllegalStateException, java.lang.NullPointerException
key
- A preference key.value
- The value to be set for the given key.
java.lang.IllegalArgumentException
- Thrown if the given key
is unknown
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closed.
If conditions to throw this exception are met it is thrown instead
of any other possible exception.
java.lang.NullPointerException
- Thrown when the given key
is null
public abstract void stop() throws java.lang.IllegalStateException
ServiceContextListener
. If this method is called
when this ServiceContext
is already in the STOPPED
state, it will be ignored.
See State Model for more details.
java.lang.IllegalStateException
- Thrown if the ServiceContext
is closed
|
Copyright 2008 Motorola Inc. and Nokia Corporation. All Rights Reserved. Specification License |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |