Sun Java System Message Queue 4.1 Developer's Guide for JMX Clients

Preface

This Message Queue Developer’s Guide for JMX Clients describes the application programming interface provided in Sun Java System Message Queue 4.1 for programmatically configuring and monitoring Message Queue resources in conformance with the Java Management Extensions (JMX). As in earlier versions of Message Queue, these functions are also available to system administrators by way of the Message Queue Administration Console and command line utilities, as described in the Message Queue Administration Guide. As of release 4.1, the API described here makes the same administrative functionality available programmatically from within a running client application.

Message Queue 4.1 also includes several new broker properties and command-line options to support the new JMX API. These features are described in the Message Queue Release Notes for release 4.1, and will eventually be incorporated into the Message Queue Administration Guide.

Who Should Use This Book

This guide is intended for Java application developers wishing to use the Message Queue JMX API to perform Message Queue administrative tasks programmatically from within a client application.

Before You Read This Book

This guide assumes that you are already familiar with general Message Queue concepts, administrative operations, and Java client programming, as described in the following manuals:

You should also be familiar with the general principles of the Java Management Extensions, as described in the following publications:

Together, these two publications are referred to hereafter as the JMX Specification.

How This Book Is Organized

This guide consists of the following chapters:

Related Documentation

In addition to this guide, Sun provides the additional documentation resources described in the following subsections.

Message Queue Documentation Set

The Message Queue documentation set comprises the documents shown in Table P–1, in the order in which you would normally use them.

Table P–1 Message Queue Documentation Set

Document 

Audience 

Description 

Message Queue Installation Guide

Developers and administrators 

Explains how to install Message Queue software on Solaris, Linux, and Windows platforms 

Message Queue Release Notes

Developers and administrators 

Includes descriptions of new features, limitations, and known bugs, as well as technical notes 

Message Queue Technical Overview

Developers and administrators 

Introduces basic Message Queue concepts, features, and components 

Message Queue Administration Guide

Administrators (also recommended for developers) 

Provides background and information needed to perform administrative tasks using Message Queue administration tools 

Message Queue Developer’s Guide for Java Clients

Developers 

Provides information on developing Java client programs using the Message Queue implementation of the Java Message Service (JMS) and SOAP/JAXM specifications

Message Queue Developer’s Guide for C Clients

Developers 

Provides information on developing C and C++ client programs using Message Queue's C application programming interface (C API)

Message Queue Developer’s Guide for JMX Clients

Developers 

Provides information on developing Java client programs using the Message Queue implementation of the Java Management Extensions (JMX) API

Java Management Extensions (JMX) Documentation

The Message Queue JMX API conforms to the Java Management Extensions (JMX) standard, described in the Java Management Extensions Instrumentation and Agent Specification and the Java Management Extensions (JMX) Remote API Specification. These documents can be downloaded from the URLs

http://jcp.org/aboutJava/communityprocess/final/jsr003

and

http://jcp.org/aboutJava/communityprocess/final/jsr160

respectively.

For a general conceptual introduction to JMX principles and architecture, see the Java Management Extensions (JMX) Technology Overview at

http://java.sun.com/j2se/1.5.0/docs/guide/jmx/overview/JMXoverviewTOC.html

and the Java Management Extensions (JMX) Technology Tutorial at

http://java.sun.com/j2se/1.5.0/docs/guide/jmx/tutorial/tutorialTOC.html

JavaDoc

Message Queue API documentation in JavaDoc format is included in your Message Queue installation at the locations shown in Table P–2, depending on your platform. This documentation can be viewed in any HTML browser. It includes standard JMS API documentation as well as Message Queue–specific APIs for Message Queue administered objects, which are of value to developers of messaging applications.

Table P–2 JavaDoc Locations

Platform 

Location 

Solaris 

/usr/share/javadoc/imq/index.html

Linux 

/opt/sun/mq/javadoc/index.html

Windows 

IMQ_HOME\javadoc\index.html

where IMQ_HOME is the Message Queue base directory set by the Message Queue Installer (C:\Program Files\Sun\MessageQueue4 by default)

Example Client Applications

Example client applications providing sample Java application code using JMX are included in your Message Queue installation at the locations shown in Table P–3, depending on your platform.

Table P–3 JMX Code Example Locations

Platform 

Location 

Solaris 

/usr/demo/imq/jmx

Linux 

/opt/sun/mq/examples/jmx

Windows 

IMQ_HOME\demo\jmx

where IMQ_HOME is the Message Queue base directory set by the Message Queue installer (C:\Program Files\Sun\MessageQueue4 by default)

Typographic Conventions

Table P–4 shows the typographic conventions used inMessage Queue documentation.

Table P–4 Typographic Conventions

Typeface 

Meaning 

Example 

AaBbCc123

Names of commands, files, and directories, and onscreen computer output 

Edit your .login file.

Use ls -a to list all files.

machine_name% you have mail.

AaBbCc123

What you type, as contrasted with onscreen computer output 

machine_name% su

Password:

aabbcc123

Placeholder: replace with a real name or value 

The command to remove a file is rm filename.

AaBbCc123

Book titles, new terms, and emphasized words 

Read Chapter 6 in the User's Guide.

A cache is a copy that is stored locally.

Do not save the file.


Note –

Some emphasized items appear online in boldface.


Symbol Conventions

Table P–5 shows symbol conventions used inMessage Queue documentation.

Table P–5 Symbol Conventions

Symbol 

Description 

Example 

Meaning 

[ ]

Encloses optional arguments and command options 

ls [-l]

The -l option is optional.

{ | }

Encloses a set of choices for a required command option 

-d {y|n}

The -d option requires that you use either the y argument or the n argument.

${ }

Indicates a variable reference 

${com.sun.javaRoot}

References the value of the variable com.sun.javaRoot.

Joins simultaneous multiple keystrokes 

Ctrl-A 

Hold down the Control key while pressing the A key.  

Joins consecutive multiple keystrokes 

Ctrl+A+N 

Press the Control key, release it, and then press the subsequent keys.  

-> 

Indicates hierarchical menu selection in a graphical user interface 

File -> New -> Templates 

From the File menu, choose New; from the New submenu, choose Templates.  

Directory Variable Conventions

Message Queue makes use of three directory variables; how they are set varies from platform to platform. Table P–6 describes these variables and how they are used on the Solaris, Linux, and Windows platforms.


Note –

The information in Table P–6 applies only to the standalone installation of Message Queue. When Message Queue is installed and run as part of an Application Server installation, the values of the directory variables are set differently: IMQ_HOME is set to appServer_install_dir/imq (where appServer_install_dir is the Application Server installation directory), and IMQ_VARHOME is set to appServer_domainName_dir/imq (where appServer_domainName_dir is the domain directory for the domain starting the Message Queue broker).


Table P–6 Directory Variable Conventions

Variable 

Description 

IMQ_HOME

The Message Queue base directory (root installation directory):  

  • Unused on Solaris and Linux; there is no Message Queue base directory.

  • On Windows, set by the Message Queue Installer to the directory in which you unzip the Message Queue bundle.

IMQ_VARHOME

The directory in which Message Queue temporary or dynamically created configuration and data files are stored; can be set as an environment variable to point to any directory.  

  • On Solaris, defaults to /var/imq.

  • On Linux, defaults to /var/opt/sun/mq.

  • On Windows, defaults to IMQ_HOME\var.

IMQ_JAVAHOME

The location of the Java runtime environment (JRE) required by Message Queue executables:

  • On Solaris and Linux, set by default to the location of the latest JRE, but can optionally be set to point to another, preferred JRE instead.

  • On Windows, set to the location of an existing JRE if a supported version is found on the system. If a supported version is not found, one will be installed.


Note –

In this manual, these directory variables are shown without platform-specific environment variable notation or syntax (such as $IMQ_HOME on UNIX). Pathnames generally use UNIX directory separator notation (/).


Shell Prompts in Command Examples

Table P–7 shows the default UNIX® system prompt and superuser prompt for the C shell, Bourne shell, Korn shell, and Windows operating system.

Table P–7 Shell Prompts

Shell 

Prompt 

C shell 

machine_name%

C shell for superuser 

machine_name#

Bourne shell and Korn shell 

$

Bourne shell and Korn shell for superuser 

#

Windows 

C:\

Documentation, Support, and Training

The Sun Web site provides information about the following additional resources:

Searching Sun Product Documentation

Besides searching Sun product documentation from the docs.sun.com Web site, you can use a search engine by typing the following syntax in the search field:

search-term site:docs.sun.com

For example, to search for “broker,” type the following:

broker site:docs.sun.com

To include other Sun Web sites in your search such as java.sun.com, www.sun.com, and developers.sun.com), use sun.com in place of docs.sun.com in the search field.

Third-Party Web Site References

Third-party URLs referenced in this document provide additional, related information.


Note –

Sun is not responsible for the availability of third-party Web sites mentioned in this document. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services that are available on or through such sites or resources.


Sun Welcomes Your Comments

Sun is always interested in improving its documentation and welcomes your comments and suggestions. To share your comments, go to the Sun documentation Web site at

http://docs.sun.com

and click Send Comments. In the resulting online form, provide the document title and part number along with your comment. (The part number is a 7-digit or 9-digit number that can be found on the book’s title page or in the document's URL. For example, the part number of this book is 819-7758.)