Giving parameters to the MIDlet

A useful feature of MIDlets is that they can retrieve parameters from their jad file. The example applications take advantage of this to allow simple changes to the MIDP clients without having to alter the code. Unfortunately, you cannot perform the necessary changes to the jad file in WSDD. To use this feature, open the jad of your project in a text editor. User defined parameters are specified as follows:

parameter: value

Use the following parameters for the two example applications:

  1. MsgPump Client

    Pump_SecurityLevel
    Specifies the security level that the application 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
  2. TextApp Client

    pp_Registration_ServerIP
    The IP address of the registration server

    App_Gateway_ServerIP
    The IP address of the gateway server

An example jad file may look something like this:

MIDlet-Version:  
MIDlet-Name: ExampleAppv2NewestMQe MIDlet-Jar-Size:  
MIDlet-Jar-URL:  
MIDlet-1: pumpclient,,mqeexampleapp.msgpump.MidpClient 
MIDlet-2: clear,,mqeexampleapp.messageservice.RMSclear 
MIDlet-3: textapp,,mqeexampleapp.textapp.MidpClient 
MIDlet-Vendor:   
 
Pump_SecurityLevel: 0 
Pump_ServerQueue: A_Queue 
Pump_ServerPort: 8083 
Pump_ServerQueueManager: QM_Mr_Server 
Pump_ServerIP: 10.0.0.101  
 
App_Registration_ServerIP: 10.0.0.100 
App_Gateway_ServerIP: 10.0.0.131

Any value not specified in this manner defaults to its usual value.



© IBM Corporation 2002. All Rights Reserved