public final class SuiteManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addSuiteListener(Suite suite,
SuiteListener theListener)
Adds a
SuiteListener for the specified Suite . |
Suite |
getSuite(java.lang.String vendor,
java.lang.String name)
Returns the instance of the installed
Suite . |
static SuiteInstaller |
getSuiteInstaller(byte[] instData,
int offset,
int length,
boolean ignoreUpdateLock,
int suiteInitialState)
Returns
SuiteInstaller . |
static SuiteInstaller |
getSuiteInstaller(java.lang.String locationUrl,
boolean ignoreUpdateLock,
int suiteInitialState)
Returns
SuiteInstaller . |
static SuiteManager |
getSuiteManager()
Returns
SuiteManager instance. |
java.util.List<Suite> |
getSuites(SuiteType type)
Request a list of installed suites of specified type.
|
void |
removeStatusListener(Suite suite,
SuiteListener theListener)
Removes a
SuiteListener for the specified Suite . |
void |
removeSuite(Suite suite,
boolean ignoreRemoveLock)
Removes a software package.
|
public static SuiteManager getSuiteManager() throws java.lang.SecurityException
SuiteManager
instance.
To be able to retreive the suite manager, caller application should
request javax.microedition.swm.SWMPermission("manageSuite")
permission.SuiteManager
instancejava.lang.SecurityException
- if the caller application does not have the required
javax.microedition.swm.SWMPermission("manageSuite")
permissionpublic static SuiteInstaller getSuiteInstaller(java.lang.String locationUrl, boolean ignoreUpdateLock, int suiteInitialState) throws java.lang.SecurityException, java.lang.IllegalArgumentException
SuiteInstaller
.
To be able to retreive the application installer, caller application should
request javax.microedition.swm.SWMPermission("installation")
permission.
The function can result in network access for the application descriptor acquiring.
The resulting SuiteInstaller
can be used for both, the
installation of an application suite being new to the device (in this case
the parameter ignoreUpdateLock
, see below, is without meaning),
or the update of an application suite that had already been installed
on the device before.
locationUrl
- URL indicating the network location where
the jad/jar files can be retrieved fromignoreUpdateLock
- if true
the application suite
components will be updated even if lock for update is set.
This option should be used with caution and programmers should always
set this parameter to false
.suiteInitialState
- the initial state of the suite to install
(for list of states see Suite
)SuiteInstaller
java.lang.SecurityException
- if the caller application does not have the required
javax.microedition.swm.SWMPermission("installation")
permissionjava.lang.IllegalArgumentException
- if the locationUrl is not a valid URL,
the server is not reachable, or the suiteInitialState has an invalid valuepublic static SuiteInstaller getSuiteInstaller(byte[] instData, int offset, int length, boolean ignoreUpdateLock, int suiteInitialState) throws java.lang.SecurityException, java.lang.IllegalArgumentException
SuiteInstaller
.
To be able to retreive the application installer, caller application should
request javax.microedition.swm.SWMPermission("installation")
permission.
A SuiteInstaller can be used to install the application from an in-memory buffer, where the data have been brought to before.
The resulting SuiteInstaller
can be used for both, the
installation of an application suite being new to the device (in this case
the parameter ignoreUpdateLock
, see below, is without meaning),
or the update of an application suite that had already been installed
on the device before.
instData
- in-memory buffer where the installation data can be
retrieved fromoffset
- offset within the in-memory buffer the installation
data will be retrieved fromlength
- length of the installation data to be retrieved from
the in-memory bufferignoreUpdateLock
- if true
the application suite
components will be updated even if lock for update is set.
This option should be used with caution and programmers should always
set this parameter to false
.suiteInitialState
- the initial state of the suite to install
(for list of states see Suite
)SuiteInstaller
java.lang.SecurityException
- if the caller application does not have the required
javax.microedition.swm.SWMPermission("installation")
permissionjava.lang.IllegalArgumentException
- if the byte array is empty, the offset
or offset+length
exceeds the boundaries of the
byte array, or the suiteInitialState has an invalid valuepublic Suite getSuite(java.lang.String vendor, java.lang.String name)
Suite
.vendor
- vendor name of the requested suitename
- the name of the suiteSuite
instance of the application
or null
if no application was foundpublic java.util.List<Suite> getSuites(SuiteType type)
type
- must be one of:
SuiteType.ST_APPLICATION
, SuiteType.ST_LIBRARY
, or
SuiteType.ST_LINK
Suite
instancespublic void addSuiteListener(Suite suite, SuiteListener theListener)
SuiteListener
for the specified Suite
. Several
listeners can be added, all get notified about state changes of the suite.suite
- the suite the listener will be added fortheListener
- SuiteListener
to be addedpublic void removeStatusListener(Suite suite, SuiteListener theListener)
SuiteListener
for the specified Suite
.suite
- the suite the listener will be removed fortheListener
- SuiteListener
to be removedpublic void removeSuite(Suite suite, boolean ignoreRemoveLock) throws SuiteLockedException, SuiteNotFoundException
If the component is in use it must continue to be available to the other components that are using it. The resources it consumes must not be released until it is not in use.
suite
- the suite to be removedignoreRemoveLock
- if true
suite
is removed
even if it has state flag SuiteStateFlag.SSF_REMOVE_DENIED
SuiteLockedException
- is thrown, if suite
is locked
and the ignoreRemoveLock
parameter is set to
false
.
In some implementation specific cases this exception MAY be also
thrown if the ignoreRemoveLock
parameter is set to
true
.
For details about when suite
is called locked
, see SuiteLockedException
.SuiteNotFoundException
- is thrown if the suite has already been
removedCopyright (c) 2013, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.