FileDocCategorySizeDatePackage
WMACleanupMonitor.javaAPI DocphoneME MR2 API (J2ME)4298Wed May 02 18:00:32 BST 2007com.sun.midp.wma

WMACleanupMonitor

public class WMACleanupMonitor extends Object implements com.sun.midp.main.MIDletProxyListListener
The function of this class is to call a native WMA function, when a MIDletSuite terminates. The native function will perform any cleanup that is required, eg: delete any messages left unread by the MIDletSuite. This class implements the MIDletProxyListener interface and is thus notified whenever a MIDletSuite is installed or removed.

Two versions of this file exist: one which is a no-op, is used, when MIDP stack is not built with JSR 205 and the real implementation when MIDP stack is built with JSR205.

Fields Summary
Constructors Summary
private WMACleanupMonitor()
Prevents instantiation of this class.

    
Methods Summary
private native voiddeleteMessages0(int msid)
Native function to delete SMS/CBS/MMS messages left unread by the MIDlet suite that is terminating.

param
msid Midlet Suite ID.

public static voidinit(com.sun.midp.main.MIDletProxyList mpl)
Initialization function for the WMA cleanup service. Adds itself as a listener, so as to be notified on suite removal.

param
mpl A midlet proxy list, passed down by the suite loader.

        mpl.addListener(new WMACleanupMonitor());
    
public voidmidletAdded(com.sun.midp.main.MIDletProxy midlet)
The WMACleanup monitor ignores MIDlet added callbacks. The necessary initialization is done in the Isolate and MIDletState that instantiates the MIDlet. Called when a MIDlet is added to the list and only in the AMS Isolate.

param
midlet The proxy of the MIDlet being added

    
public voidmidletRemoved(com.sun.midp.main.MIDletProxy midlet)
The WMACleanup monitor uses the MIDlet removed callback to delete any messages left unread by the MIDlet suite.. Called (in the AMS Isolate) when a MIDlet is removed from the list.

param
midlet The proxy of the removed MIDlet

        deleteMessages0(midlet.getSuiteId());
    
public voidmidletStartError(int externalAppId, int suiteId, java.lang.String className, int errorCode, java.lang.String errorDetails)
The WMACleanup monitor ignores MIDlet start error callbacks. Called when error occurred while starting a MIDlet object.

param
externalAppId ID assigned by the external application manager
param
suiteId Suite ID of the MIDlet
param
className Class name of the MIDlet
param
errorCode start error code
param
errorDetails start error details

    
public voidmidletUpdated(com.sun.midp.main.MIDletProxy midlet, int fieldId)
The WMACleanup monitor ignores MIDlet update callbacks. Called when the state of a MIDlet in the list is updated.

param
midlet The proxy of the MIDlet that was updated
param
fieldId code for which field of the proxy was updated, see constants above