Websphere MQ Everyplace

examples.administration.commandline
Class ListenerCreate

java.lang.Object
  |
  +--examples.administration.commandline.MQeAbstractCmdLineAdminTool
        |
        +--examples.administration.commandline.ListenerCreate

public class ListenerCreate
extends MQeAbstractCmdLineAdminTool

A command-line tool to allow someone to add a Listener to an MQe queue manager without programming anything in Java. This version uses the admin messages to send the command to the destination queue manager, and so can be used to add a listener to a remote queue manager. This version is design to setup listeners that use tcpip based protocols.

Syntax

java examples.administration.commandline.ListenerCreate <listenerName> <qMgr> <listenAdapter> <listenPort> <channelTimeout> <maxChannels> <ini_file>

listenerName
The name of listener which is to be created.
qMgr
The MQe queue manager to which the listener will be added. Normally this would be the same as the queue manager that this example runs.
listenAdapter
The communications adapter that will do the listening. This can be the name of the adapter class like com.ibm.mqe.adapters.MQeTcpipHttpAdapter or an alias like Network
listenPort
The port that adapter will use to listen for new incoming requests, for example 8082
channelTimeout
The time in milliseconds that idle incoming channels live before being timed out.
maxChannels
The maximum number of channels the listener allows to be open at any one time.
iniFile
The fully qualified path of the .ini file used by this tool to instantiate a device queue manager, send the admin message, and wait for the reply. Works with MQe 1.x style .ini files.

Examples

This tool would normally be used to create a listener on the local queue manager for example: ...ListenerCreate ListenerName MyDeviceQM Network 8082 300000 100 C:\MQe\...\MyDeviceQM.ini


Field Summary
static short[] version
           
 
Fields inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
ADMIN_Q_NAME, REPLY_TO_Q, TIMEOUT_MILLISECS
 
Constructor Summary
ListenerCreate()
           
 
Method Summary
 void activate(java.lang.String[] args)
          Gathers command-line parameters into variables, and calls the method which creates the queue.
static void createListener(java.lang.String listenerName, java.lang.String listenAdapter, int listenPort, long channelTimeout, int maxChannels, java.lang.String targetQMgr, MQeQueueManager myQMgr)
          Creates an admin message which will cause a listener to be created then it sends it to a queue manager.
static void main(java.lang.String[] args)
          Entry point from the command line.
 
Methods inherited from class examples.administration.commandline.MQeAbstractCmdLineAdminTool
checkAdminReply, primeAdminMsg, processAdminMsg, sendWaitMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version
Constructor Detail

ListenerCreate

public ListenerCreate()
Method Detail

main

public static void main(java.lang.String[] args)
Entry point from the command line.

Parameters:
args - Command-line arguments being passed in.

activate

public void activate(java.lang.String[] args)
              throws java.lang.Exception
Gathers command-line parameters into variables, and calls the method which creates the queue.

Parameters:
args -
Returns:
void
Throws:
java.lang.Exception

createListener

public static void createListener(java.lang.String listenerName,
                                  java.lang.String listenAdapter,
                                  int listenPort,
                                  long channelTimeout,
                                  int maxChannels,
                                  java.lang.String targetQMgr,
                                  MQeQueueManager myQMgr)
                           throws java.lang.Exception
Creates an admin message which will cause a listener to be created then it sends it to a queue manager.

Parameters:
listenerName - (java.lang.String) The name of listener which is to be created.
listenAdapter - (String) The communications adapter used to listen for new incoming requests. This may be an alias or actual class name of the adapter.
listenPort - (int) The port to listen on
channelTimeout - (long) Timeout period expressed in milliseconds. This is used to control how long incoming channels can remain idle before being timed out
targetQMgr - The name of the queue manager to which the admin message will be sent.
myQMgr - The reference to an active MQe queue manager object, which will be used to send the admin message, and receive the reply.
Throws:
java.lang.Exception

Websphere MQ Everyplace