Methods Summary |
---|
public void | addProperty(java.lang.String key, java.lang.String value)Add a property to the suite.
MIDletSuite current = Scheduler.getScheduler().getMIDletSuite();
if (current != null) {
current.checkIfPermissionAllowed(Permissions.MIDP);
}
bufferedJadProps.addProperty(key, value);
|
public void | checkForPermission(int permission, java.lang.String resource)Check for permission and throw an exception if not allowed.
May block to ask the user a question.
String app;
app = getProperty(Installer.SUITE_NAME_PROP);
if (app == null) {
app = initialMIDletClassName;
}
super.checkForPermission(permission, app, resource);
|
public static com.sun.midp.midlet.MIDletSuite | create(com.sun.midp.security.SecurityToken callerSecurityToken, java.lang.String jadFilename, java.lang.String midletClassName, java.lang.String storageName, java.lang.String domain)Creates MIDletSuite from a raw JAD.
return create(callerSecurityToken, jadFilename, midletClassName,
storageName, null, null, domain, !(domain == null ||
domain.equals(Permissions.UNTRUSTED_DOMAIN_NAME)),
null, null);
|
public static com.sun.midp.midlet.MIDletSuite | create(com.sun.midp.security.SecurityToken callerSecurityToken, java.lang.String jadFilename, java.lang.String midletClassName, java.lang.String storageName, java.lang.String[] keys, java.lang.String[] values, java.lang.String domain, boolean trusted, java.lang.String pushQuestion, java.lang.String alarmQuestion)Creates MIDletSuite from a raw JAD.
DevMIDletSuiteImpl suite;
RandomAccessStream storage;
InputStream jadStream;
byte[][] temp;
int pushSetting;
if (domain == null) {
domain = Permissions.UNTRUSTED_DOMAIN_NAME;
}
temp = Permissions.forDomain(callerSecurityToken, domain);
if (temp[Permissions.CUR_LEVELS][Permissions.PUSH] ==
Permissions.NEVER) {
pushSetting = Permissions.NEVER;
} else if (temp[Permissions.CUR_LEVELS][Permissions.PUSH] ==
Permissions.ALLOW) {
pushSetting = Permissions.BLANKET;
} else {
pushSetting = temp[Permissions.CUR_LEVELS][Permissions.PUSH];
}
suite = new DevMIDletSuiteImpl(callerSecurityToken, temp, pushSetting,
trusted, storageName);
if (jadFilename != null) {
storage = new RandomAccessStream(callerSecurityToken);
storage.connect(jadFilename, Connector.READ);
try {
jadStream = storage.openInputStream();
suite.bufferedJadProps.load(jadStream);
} finally {
storage.disconnect();
}
suite.numberOfMidlets = suite.countMIDlets();
} else {
// without a jad we must assume at least one MIDlet
suite.numberOfMidlets = 1;
}
if (keys != null) {
for (int i = 0; i < keys.length; i++) {
suite.bufferedJadProps.setProperty(keys[i], values[i]);
}
}
suite.storageRoot = File.getStorageRoot() + storageName;
suite.initialMIDletClassName = midletClassName;
if (pushQuestion != null) {
suite.pushInterruptQuestion = pushQuestion;
} else {
suite.pushInterruptQuestion = PUSH_INTERRUPT_QUESTION;
}
if (alarmQuestion != null) {
suite.alarmInterruptQuestion = alarmQuestion;
} else {
suite.alarmInterruptQuestion = ALARM_INTERRUPT_QUESTION;
}
return suite;
|
protected java.lang.String | getAlarmInterruptQuestion()Get the Alarm interrupt question the should be used when
interrupting this suite.
The question will have %2 where this suite name should be and
a %1 where the current suite name should be.
return alarmInterruptQuestion;
|
public java.lang.String | getCA()Gets the name of CA that authorized this suite.
return null;
|
public java.lang.String | getInitialMIDletClassname()Get the classname of the initial MIDlet to run.
if (initialMIDletClassName != null) {
return initialMIDletClassName;
}
// Have the user select a MIDlet. The selector should not exit.
return "com.sun.midp.dev.PersistentSelector";
|
public java.lang.String | getJadUrl()The JAD URL of the suite. This is only for the installer.
return null;
|
public java.lang.String | getJarUrl()The JAR URL of the suite. This is only for the installer.
return "none";
|
public int | getNumberOfMIDlets()Provides the number of of MIDlets in this suite.
return numberOfMidlets;
|
public java.lang.String | getProperty(java.lang.String key)Get a property of the suite. A property is an attribute from
the application descriptor.
return bufferedJadProps.getProperty(key);
|
protected java.lang.String | getPushInterruptQuestion()Get the Push interrupt question the should be used when
interrupting this suite.
The question will have %2 where this suite name should be and
a %1 where the current suite name should be.
return pushInterruptQuestion;
|
public byte[] | getResource(java.lang.String name)Get a named resource out of the JAR of this MIDlet suite.
return null;
|
public java.lang.String | getStorageRoot()Gets the path root of any file this suite.
Has any needed file separators appended.
return storageRoot;
|
public int | getStorageUsed()Get the amount of storage on the device that this suite is using.
This includes the JAD, JAR, management data, and RMS.
return 0;
|
protected java.lang.String | getSuiteNameForInterrupt()Get the suite name for interruption purposes.
String name = getProperty(Installer.SUITE_NAME_PROP);
if (name != null) {
return name;
}
return initialMIDletClassName;
|
public void | saveSettings()Save any the settings (security or others) that the user may have
changed. Normally called by the scheduler after
the last running MIDlet in the suite is destoryed.
However it could be call during a suspend of the VM so
that persisent settings of the suite can be perserved.
// we do not save the settings for classes run from the classpath
|