| java.lang.Object com.sun.midp.jump.push.executive.AlarmController
AlarmController | final class AlarmController (Code) | | Controller that manages alarms.
IMPORTANT_NOTE: As this class uses Store to keep
alarms data in persistent store, the clients of this class must ensure
that the underlying content store can be exclusively locked when public
methods of this class get invoked.
|
Method Summary | |
public synchronized void | dispose() Disposes an alarm controller. | public synchronized long | registerAlarm(int midletSuiteID, String midlet, long time) Registers an alarm.
NOTE: midletSuiteID parameter should refer to a valid
MIDlet suite and midlet should refer to
valid MIDlet from the given suite. | public synchronized void | removeSuiteAlarms(int midletSuiteID) Removes alarms for the given suite.
NOTE: midletSuiteID must refer to valid installed
MIDlet suite. |
AlarmController | public AlarmController(Store store, LifecycleAdapter lifecycleAdapter)(Code) | | Constructs an alarm controller.
NOTE: both store and lifecycleAdapter
MUST be not null . There is no checks and passing
null leads to undefined behaviour.
Parameters: store - persistent store to save alarm info into(cannot be null ) Parameters: lifecycleAdapter - adapter to launch MIDlet (cannot be null ) |
dispose | public synchronized void dispose()(Code) | | Disposes an alarm controller.
NOTE: This method is needed as Timer creates
non daemon thread which would prevent the app from exit.
NOTE: after AlarmController is disposed, attempt to perform
any alarms related activity on it leads to undefined behaviour.
|
registerAlarm | public synchronized long registerAlarm(int midletSuiteID, String midlet, long time) throws ConnectionNotFoundException(Code) | | Registers an alarm.
NOTE: midletSuiteID parameter should refer to a valid
MIDlet suite and midlet should refer to
valid MIDlet from the given suite. timer
parameters is the same as for corresponding Date
constructor. No checks are performed and no guarantees are
given if parameters are invalid.
Parameters: midletSuiteID - MIDlet suite ID Parameters: midlet - MIDlet class name Parameters: time - alarm time throws: ConnectionNotFoundException - if for any reason alarm cannot beregistered previous alarm time or 0 if none |
removeSuiteAlarms | public synchronized void removeSuiteAlarms(int midletSuiteID)(Code) | | Removes alarms for the given suite.
NOTE: midletSuiteID must refer to valid installed
MIDlet suite. However, it might refer to the
suite without alarms.
Parameters: midletSuiteID - ID of the suite to remove alarms for |
|
|