One of the examples provided with WebSphere MQ Everyplace is an
administration graphical user interface (GUI). This example uses many
of the administration techniques and features described in previous sections
of this manual. All the classes for this example are contained in
package examples.administration.console.
This example demonstrates the following WebSphere MQ Everyplace
administration features:
- Management of both local and remote queue managers
- Administration of all WebSphere MQ Everyplace managed resources
- Access to all actions of each managed resource
- Use of most of the base MQeAdminMsg features
- A queue browser
- A customized version of the queue browser for the administration reply
queue.
This is provided solely as a programming example, it is not expected
to be used outside a development and test environment. It should
be noted that this example works with other examples such as trace, and the
client queue manager, and it is also subclassified to provide an
administration example for the WebSphere MQ bridge.
To start the console use the command:
java examples.administration.console.Admin
This displays the following window:
Figure 4. Administration console window

This is the central window from which all other interactions are
initiated. The window has three sections:
- 1. Type of resource to manage
- The set of buttons on the left side of the window control the selection of
the resource that is to be managed. There is one button for each type
of WebSphere MQ Everyplace managed resource and one button called
Setup. The Setup button provides access to a set
of base administration functions such as browsing the reply-to queue and
turning trace on and off.
- 2. Base administration parameters
- The central section of the window allows base administration parameters to
be altered.
- Mode
- Whether the queue manager to be managed is local or remote.
- Local queue manager
- The name of the local queue manager that is initiating the administration
actions. This is set automatically when a queue manager is started with
the Start QM button.
- Managed queue manager
- If the mode is set to remote, this is the name of the queue manager to be
managed. If the mode is set to local, this is always the same as the
local queue manager.
- Reply-to queue manager
- The name of the queue manager to which administration reply messages are
to be sent.
- Reply-to queue
- The name of the queue to which administration reply messages are to be
sent.
- 3. Managed resource specific action
- Each managed resource has a set of actions that can be performed on
it. The buttons on the right of the main window show the actions for
the resource that is selected on the left of the window. Selecting one
of an action button starts the function for that action. Normally this
causes the display of another window related to the action.
The selected local queue manager must be running in the JVM that the
console is executing in. If it is not already running, it needs to be
started using the Start QM button. This displays a dialog
that requests the name and path of the ini file that contains the queue
manager startup parameters. If the queue manager is already running,
the Connect QM button can be selected (this is the case if
administration is started from the example server ExampleAwtMQeServer).
Once the queue manager has been started, any of the resources in area 1 can
be selected and managed.
An example queue browser, AdminQueueBrowser is provided with WebSphere MQ
Everyplace. This example shows how to browse a queue and how to display
the contents of messages on the queue. The example can only browse
queues that can be accessed synchronously and that the user has the necessary
authority to access. The example code is not able to show the messages
that are secured using message level security.
AdminQueueBrowser has been subclassified to provide a queue browser with
enhanced function for browsing the administration reply-to queue. This
is implemented in class AdminLogBrowser. This subclass can be accessed
by selecting the Setup button followed by the Browse reply
queue button.
The following figure shows the administration reply-to queue window.
Figure 5. Reply-to queue window

This window has several sections:
- 1. The name of the administration reply to queue manager and queue
-
- 2. Message filter
- You can provide a filter to limit the set of messages displayed.
This example allows a filter on the MsgID and
CorrelID fields of a message. The example also
makes the assumption that the fields contain strings that have been encoded in
a byte array.
When administration messages are sent from the example console, the
MsgID is set to the name of the queue manager to be
managed. It is therefore possible to display administration messages
only for a specific queue manager.
- 3. Message view type
- You can view messages in the message display panel in the following
ways:
- List:
- A one line summary of each message on the queue.
- Full:
- The contents of all messages on the queue.
- Both:
- Two panels, one panel displays a list with a summary line for each
message, the other panel displays the contents of a message that has been
selected in the message panel.
The number of messages currently being viewed is also displayed.
- 4. Message display panel
- As described in 3, this panel displays messages in various forms.
To display a detailed view of a message in a new window, double click the
message in the list view.
- 5. Actions
- Several buttons provide actions that are specific to the queue
browser:
- Refresh
- Clears the display and then displays the current contents of the
queue. If the queue being browsed is a local queue, a monitor is
automatically started. This monitor refreshes the display when new
messages are added to the queue. If the queue being browsed is remote
then it is not possible to automatically refresh the window when new messages
are added. In this case, the Refresh button can be used to
get the latest contents of the queue.
- Empty Queue
- Deletes all messages from the queue.
- Cancel
- Closes the queue browser window.
- 6. Message
- Error and status messages are displayed here.
Once you have selected a managed resource type, and you have clicked an
action button, a window opens that displays a list of possible parameters for
the action. Some parameters are mandatory, others are optional.
The following figure shows an example of selecting the add action on a
connection:
Figure 6. Action window

The action window is the same for most actions. It consists of the
following parts:
- 1. Message area
- Error and status messages are displayed here.
- 2. Names of parameter
- Action parameter names.
- 3. Value of parameter
- An input field where you can change the parameter values. The
initial value displayed is the default value for the parameter.
- 4. Send field
- The check box for each field is automatically selected when a value is
changed. When this field is selected, the field is included in the
administration message. By default the administration message only
contains values that have changed, it does not contain default values.
Default values are understood by the administration message and are not
included in the message to ensure that the message size is kept as small as
possible. If you change a value back to its default, you must select
the send field check box yourself.
- 5. Action buttons
- For each administration action there are three buttons:
- Action
- The name on this button depends on the administration action. In
this example it is Add connection. The action is always to
create the administration message and send it to the destination queue
manager. The action window is closed.
- Apply
- Create the administration message and send it to the destination queue
manager. The action window remains open allowing the same message to be
sent multiple times or it can be modified and then sent.
- Cancel
- Close the action window without sending the administration message.
You can view the outcome of an administration request with the
administration log browser as described in Queue browser. To see the details of the result of the request,
double click on the reply message in the list view.
Figure 7. Reply window

The window has the same basic structure as an administration request action
window but has the following differences:
- 1. Message
- Displays the return code and result of the action.
- 2. Detailed errors
- If the return code was RC_Mixed, any errors relating to a
particular field are displayed alongside the field.
- 3. Action buttons
-
- OK
- Close the action reply window.
© IBM Corporation 2002, 2003. All Rights Reserved