org.mockme.midlet
Class MIDletApplicationManager

java.lang.Object
  extended by org.mockme.midlet.MIDletApplicationManager

public class MIDletApplicationManager
extends Object

Default implementation of an application manager for MIDlets. If a MIDlet require application properties this default implementation can be used to add those properties. It can also be used to control the lifecycle of a MIDlet.

Author:
Magnus Robertsson

Constructor Summary
MIDletApplicationManager()
           
 
Method Summary
 int checkPermission(String permission)
           
 void destroyMIDlet(MIDlet midlet, boolean unconditional)
           
 String getAppProperty(String key)
          Returns an application property from the application manager.
static MIDletApplicationManager getInstance()
           
 void notifyDestroyed()
           
 void notifyPaused()
           
 void pauseMIDlet(MIDlet midlet)
           
 boolean platformRequest(String url)
           
 void registerMIDlet(MIDlet midlet, MIDletLifecycle midletLifecycle)
           
 void resumeRequest()
           
 void setAppProperty(String key, String value)
          Sets an application property that is returned by a MIDlet.
static void setInstance(MIDletApplicationManager newInstance)
          Method used to mock the MIDletApplicationManager.
 void startMIDlet(MIDlet midlet)
          Starts a MIDlet, i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MIDletApplicationManager

public MIDletApplicationManager()
Method Detail

getInstance

public static MIDletApplicationManager getInstance()

setInstance

public static void setInstance(MIDletApplicationManager newInstance)
Method used to mock the MIDletApplicationManager.

Parameters:
newInstance - The new instance to be returned by getInstance()

setAppProperty

public void setAppProperty(String key,
                           String value)
Sets an application property that is returned by a MIDlet.

Parameters:
key - The application property key.
value - The application property value.

getAppProperty

public String getAppProperty(String key)
Returns an application property from the application manager.

Parameters:
key - The application property key.
Returns:
The application property value.

startMIDlet

public void startMIDlet(MIDlet midlet)
                 throws MIDletStateChangeException
Starts a MIDlet, i.e. MIDlet.startApp() will be called.

Parameters:
midlet - The MIDlet to start.
Throws:
MIDletStateChangeException

pauseMIDlet

public void pauseMIDlet(MIDlet midlet)

destroyMIDlet

public void destroyMIDlet(MIDlet midlet,
                          boolean unconditional)
                   throws MIDletStateChangeException
Throws:
MIDletStateChangeException

notifyDestroyed

public void notifyDestroyed()

notifyPaused

public void notifyPaused()

resumeRequest

public void resumeRequest()

platformRequest

public boolean platformRequest(String url)

checkPermission

public int checkPermission(String permission)

registerMIDlet

public void registerMIDlet(MIDlet midlet,
                           MIDletLifecycle midletLifecycle)


Copyright © 2006-2007 Jayway AB. All Rights Reserved.