Creating a custom Java administrative client program using WebSphere Application Server administrative Java APIs

Why and when to perform this task

This section describes how to develop a Java program using the WebSphere Application Server administrative APIs for accessing the WebSphere administrative system. For more information, view the JMX Javadoc .

When you develop and run administrative 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 administrative client before you create and use another administrative client.
  2. Create and use an administrative client on the same thread.
  3. Use one of the following ways to specify a user ID and password to create a new administrative client::
    • Specify a default user ID and password in the property file.
    • Specify a user ID and password other than the default. Once you create an administrative client with a nondefault user ID and password, specify the nondefault user ID and password when you create subsequent administrative clients.

Steps for this task

  1. Develop an administrative client program.
  2. Build the administrative client program by compiling it with javac and providing the location of the necessary JAR files in the classpath argument.

    For example, if your installation directory is w:\DeploymentManager a typical command would look like the following example:

    javac -classpath 
    w:\DeploymentManager\lib\admin.jar;w:\DeploymentManager\lib\wsexception.jar;
    w:\DeploymentManager\lib\jmxc.jar 
    MyAdminClient.java
    (split for publication)(split for publication)
  3. Run the administrative client program by setting up the run-time 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 is an example of a batch file that runs an administrative client program named MyAdminClient:
    @echo off
    
    call "%~dp0setupCmdLine.bat"
    
    "%JAVA_HOME%\bin\java" "%CLIENTSAS%" "-Dwas.install.root=%WAS_HOME%" 
    "-Dwas.repository.root=%CONFIG_ROOT%" -Dcom.ibm.CORBA.BootstrapHost=%COMPUTERNAME% 
    -classpath "%WAS_CLASSPATH%;w:\DeploymentManager\classes;w:\DeploymentManager\lib\admin.jar;
    w:\DeploymentManager\lib\wasjmx.jar" MyAdminClient %*
    




Searchable topic ID:   txml_customjava
Last updated: Jun 21, 2007 4:55:42 PM CDT    WebSphere Application Server Network Deployment, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/tjmx_customjava.html

Library | Support | Terms of Use | Feedback