com.alarexgroup.m2mplf
Class M2Mlet

java.lang.Object
  extended by MIDlet
      extended by com.alarexgroup.m2mplf.M2Mlet
Direct Known Subclasses:
CountImpulses, DbExample, Echo, HelloWorld, POSTHTTPData, PublicDemo, ReceiveFromSerial, SendSMS, SendValue, SerialDemo, Schedule, TestM2Mlet
public abstract class M2Mlet
extends MIDlet

This is fundamental class of any M2M application written with M2MArchitect.
By extending this class you create the core of your application.

Example:

import com.alarexgroup.m2mplf.M2Mlet;
import com.alarexgroup.m2mplf.logging.Logger;

public class M2MSkelet extends M2Mlet{
    
    public M2MSkelet() {
        //Do nothing here because the engine of M2MArchitect is not yet fully loaded
    }

    public void appStart() {
        //Now, it's possible to run commands after startup
        Logger.logInfo("Application is starting!")//Saving the information to the LOG
        notifyDestroyed()//Request to terminate the application
    }
    
    public void appStop(boolean unconditional) {
        Logger.logInfo("Application finished!")//Saving the information to the LOG
        
    }

  
    public void appPause() {
        //It's possible to handle the application here when it's paused
    }
    
}

Field Summary
static java.lang.String DEFAULT_INI_CONFIG
          Path to application's main INI file (configuration)
 
Constructor Summary
M2Mlet()
           
 
Method Summary
abstract  void appPause()
          By implementing this method you can define actions to handle paused application.
abstract  void appStart()
          Abstract method that is called at application's start.
abstract  void appStop(boolean unconditional)
          By implementing this method you can define actions that are necessary when application finishes.
protected  void destroyApp(boolean unconditional)
          Internal method.
protected  void pauseApp()
          Internal method.
protected  void startApp()
          Internal method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_INI_CONFIG

public static final java.lang.String DEFAULT_INI_CONFIG
Path to application's main INI file (configuration)

See Also:
Constant Field Values
Constructor Detail

M2Mlet

public M2Mlet()
Method Detail

startApp

protected final void startApp()
                       throws MIDletStateChangeException
Internal method. It is called at application's start.

Throws:
MIDletStateChangeException - exception regarding the MIDLet's state

destroyApp

protected final void destroyApp(boolean unconditional)
                         throws MIDletStateChangeException
Internal method. It is called when application finishes.

Parameters:
unconditional -
Throws:
MIDletStateChangeException - exception regarding the MIDLet's state

pauseApp

protected final void pauseApp()
Internal method. It is called when application gets paused.

appStart

public abstract void appStart()
Abstract method that is called at application's start.
By implementing it you get a chance to define actions at application's start, e.g. initialization of various adapters.

appStop

public abstract void appStop(boolean unconditional)
By implementing this method you can define actions that are necessary when application finishes.

Parameters:
unconditional - TRUE - terminating application at once

appPause

public abstract void appPause()
By implementing this method you can define actions to handle paused application.