WebSphere Application Server Network Deployment, Version 6.1
             Operating Systems: AIX, HP-UX, i5/OS, Linux, Solaris, Windows, z/OS

             Personalize the table of contents and search results

Creating a Java Management Extensions client program using the Java Management Extensions Remote application programming interface

This topic describes how to develop and build a Java Management Extensions (JMX) client program that is compliant with JMX Remote application programming interface (JSR 160). After you have a working JMX client program, you can use it to manage WebSphere Application Server or non-WebSphere Application Server systems.

Before you begin

This task assumes a basic familiarity with JSR 160 and JMX application programming interface (API) programming. For information on JSR 160, see http://www.jcp.org/en/jsr/detail?id=160. For information on the Java APIs, view the application programming interfaces documentation.

About this task

When you develop and run JMX clients that use various JMX connectors and that have security enabled, use the following guidelines. When you follow these guidelines, you guarantee the behavior among different implementations of JMX connectors. Any programming model that strays from these guidelines is unsupported.
  1. Create and use a single JMX client before you create and use another JMX client.
  2. Create and use a JMX client on the same thread.
  3. Use one of the following ways to specify a user ID and password to create a new JMX client:
    • Specify a default user ID and password in the property file.
    • Specify a user ID and password other than the default. After you create a JMX client with a nondefault user ID and password, specify the nondefault user ID and password when you create subsequent JMX clients.

Procedure

  1. Develop a JMX client program.
  2. [AIX HP-UX Linux Solaris Windows] [i5/OS] Build and run the JMX client program.

    The steps that are required to build and run your program depend on the kind of application environment that your code runs. Refer to Using application clients for details on how to build and run your JMX client program.

  3. [z/OS] Build the JMX remote client program.

    Compile the program with the javac and provide the location of the com.ibm.ws.admin.client_6.1.0.jar file in the classpath argument. The com.ibm.ws.admin.client_6.1.0.jar file is located in the ${WAS_INSTALL_ROOT}/runtimes directory, which is a symbolic link to the /usr/lpp/zWebSphere/V6R1/runtimes directory.

    If you want to compile the JMXRemoteClientApp.java file in the current directory, use the following settings and commands:
    CLASSPATH=/usr/lpp/zWebSphere/V6R1/runtimes/com.ibm.ws.admin.client_6.1.0.jar:${CLASSPATH}
    export CLASSPATH
    ${JAVA_HOME}/bin/javac JMXRemoteClientApp.java
  4. [z/OS] Run the JMX client program.

    Run the JMX client program by setting up the runtime environment so that the program can find all of the prerequisites. Many of the batch or script files in the bin directory under the installation root perform a similar function. The following example is a batch file that runs the JMXRemoteClientApp JMX client program:

    #!/bin/sh
    CONNECTORPROPS=-Dcom.ibm.CORBA.configURL=Location_of_sas.client.props_file
    JAVA_HOME=Location_of_Java
    TAC_CLASSPATH=com.ibm.ws.admin.client_6.1.0.jar_file_location
    
    
    "${JAVA_HOME}/bin/java"  \
    -Djava.ext.dirs="${JAVA_HOME}/jre/lib/ext”  \
    -classpath "${TAC_CLASSPATH}”  ${CONNECTORPROPS}  JMXRemoteClientApp $@
    
    (The contents of the previous batch file are split on multiple lines for publication.)

Results

You have developed, built, and run a JMX client program that is JSR 160 compliant.



In this information ...


IBM Redbooks, demos, education, and more


Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

IBM Suggests
Task topic    

Terms of Use | Feedback

Last updated: Feb 25, 2009 9:32:38 AM CST
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.multiplatform.doc/info/ae/ae/tjmx_customjava_jsr160.html