|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.midlet.MIDlet | +--examples.midp.exampleapp.msgpump.MidpClient
This class acts as both controller and user interface for a MIDP pump client.
Textboxes and Forms are used to interact with users as well as display information about the current state of the client.
The client can be viewed as being in one of the following states:
- Initializing - in the process of initializing the client
- WaitingForQMname - occurs while initializing and waiting for the user to
enter the name of the QM
- Running - in the process of pumping messages
- DisplayingStatus - displaying the status of the client to the user
- DisplayingOptions - displaying the options screen to the user
- ShuttingDown - in the process of shutting down
The following jad properties are available:
Pump_SecurityLevel Specifies the security level that the app should use. 0 for no security 1 for message based security 2 for queue based security Pump_ServerQueue Specifies the name of the queue that messages should be sent to. Pump_ServerIP Specifies the IP of the server that will sent messages. Pump_ServerPort Specifies the port that the server will be listening on. Pump_ServerQueueManager Specifies the name of the queue manager that messages will be sent to.
Field Summary | |
protected MsgPumpModel |
msgPump
|
protected java.lang.Thread |
thread
|
static short[] |
version
|
Constructor Summary | |
MidpClient()
Constructor for MidpClient |
Method Summary | |
protected void |
acquiredQMName(java.lang.String name)
This function is run once the name of the queuemanager has been acquired. |
protected void |
changeDisplay(javax.microedition.lcdui.Screen newDisplayable)
Changes the current display. |
void |
commandAction(javax.microedition.lcdui.Command c,
javax.microedition.lcdui.Displayable d)
This is called if the user clicks a button. |
void |
deleteQueueManager()
Completely removes the queue manager from the system. |
void |
destroyApp(boolean arg0)
See javax.microedition.midlet#destroyApp. |
void |
displayMsg(java.lang.String msg)
For the Midpclient, messages are displayed by updating the output screen. |
MsgPumpModel |
getModel()
Returns the model or, if one doesnt currently exist, create a new one. |
protected javax.microedition.lcdui.Form |
getOptionScreen()
Generates a new options form ( it has to fill in the default values ) and then returns it. |
protected javax.microedition.lcdui.TextBox |
getOutputScreen()
Returns the default screen used to output information to the user. |
java.lang.String |
getQMname()
Checks the local record stores for signs of a client having been run previously. |
protected javax.microedition.lcdui.TextBox |
getStatusScreen()
Generates and returns a status report screen. |
void |
initialize()
This class initializes the controller. |
void |
initializeMidlet()
The equivilant of initialize. |
void |
pauseApp()
See javax.microedition.midlet#pauseApp. |
void |
processMsg(java.lang.String msg)
Processes a message to be displayed. |
protected void |
promptForQMName()
Creates and displays a prompt to the user for a new QM name. |
protected void |
setPumpProperties()
Uses properties set within the JAD file of this app to set properties of the model. |
protected void |
setQMName(java.lang.String name)
This writes the name of the QM to a record store, allowing it to be used in the future. |
void |
start()
Starts the controller running - this involves putting the model in a new thread and starting it. |
void |
startApp()
See javax.microedition.midlet#startApp. |
Methods inherited from class javax.microedition.midlet.MIDlet |
getAppProperty, notifyDestroyed, notifyPaused, resumeRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static short[] version
protected MsgPumpModel msgPump
protected java.lang.Thread thread
Constructor Detail |
public MidpClient()
Method Detail |
public void initialize() throws java.lang.Exception
Initialization involves trying to get the name of the queue manager from the RMS store. If no name is found, the user is prompted for one.
When the name is received, control will continue from commandAction()
initialize
in interface MsgPumpController
java.lang.Exception
public void deleteQueueManager()
This will of course mean that if you have both the textapp and the message pump in the same MIDlet suite, wiping one queue manager will also remove the other.
deleteQueueManager
in interface MsgPumpController
public java.lang.String getQMname()
getQMname
in interface MsgPumpController
MsgPumpController.getQMname()
public MsgPumpModel getModel()
getModel
in interface MsgPumpController
public void processMsg(java.lang.String msg)
processMsg
in interface MsgPumpController
msg
- The message to be displayed
public void start() throws java.lang.Exception
start
in interface MsgPumpController
java.lang.Exception
public void displayMsg(java.lang.String msg)
displayMsg
in interface MsgPumpController
msg
- The message to displayMsgPumpController.displayMsg(java.lang.String)
protected void setQMName(java.lang.String name)
protected void acquiredQMName(java.lang.String name)
public void startApp() throws javax.microedition.midlet.MIDletStateChangeException
startApp
in class javax.microedition.midlet.MIDlet
javax.microedition.midlet.MIDletStateChangeException
public void pauseApp()
pauseApp
in class javax.microedition.midlet.MIDlet
public void destroyApp(boolean arg0) throws javax.microedition.midlet.MIDletStateChangeException
destroyApp
in class javax.microedition.midlet.MIDlet
javax.microedition.midlet.MIDletStateChangeException
protected void setPumpProperties()
protected javax.microedition.lcdui.Form getOptionScreen()
protected javax.microedition.lcdui.TextBox getStatusScreen()
protected javax.microedition.lcdui.TextBox getOutputScreen()
public void initializeMidlet()
protected void promptForQMName()
public void commandAction(javax.microedition.lcdui.Command c, javax.microedition.lcdui.Displayable d)
See CommandListener#commandAction for more details.
commandAction
in interface javax.microedition.lcdui.CommandListener
protected void changeDisplay(javax.microedition.lcdui.Screen newDisplayable)
newDisplayable
- The new screen to be displayed
|
Websphere MQ Everyplace | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |