Return-Path: <env_28542086331453377@hermes.sun.com>
Received: from pacific-carrier-annex.mit.edu by po10.mit.edu (8.9.2/4.7) id UAA03420; Wed, 22 Jan 2003 20:39:26 -0500 (EST)
Received: from hermes.sun.com (hermes.sun.com [64.124.140.169])
	by pacific-carrier-annex.mit.edu (8.9.2/8.9.2) with SMTP id UAA22411
	for <alexp@mit.edu>; Wed, 22 Jan 2003 20:39:25 -0500 (EST)
Date: 22 Jan 2003 15:47:43 -0800
From: "JDC Tech Tips" <sunmail@hermes.sun.com>
To: alexp@mit.edu
Message-Id: <28542086331453377@hermes.sun.com>
Subject: Core Java Technologies Tech Tips, Jan. 22, 2003 (Reading Files from JARs, Into to JMX)
Mime-Version: 1.0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Mailer: SunMail 1.0

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>
Core Java Technologies Technical Tips
</title>

<style type="text/css">

code {color: #333333; font-family: Verdana, Courier, Monospace; font-size: 10pt}
pre {color: #333333; font-family: Verdana, Courier, Monospace; font-size: 10pt}
body, div, span {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
td, th {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
tr {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
table {font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
p {color: #333333; font-family: arial,helvetica,sans-serif; font-size: 10pt}
li {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
br {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
div {color: #666699; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
sup {font-family: Arial, Helvetica, sans-serif; font-size: 5pt}
h3 {color: #666699; font-family: Arial, Helvetica, sans-serif; font-size: 11pt}
h4, b {color: #666699; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
blockquote, input, select {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
ul, ol {color: #333333; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
a:link {font-size: 10pt; font-family: Arial, Helvetica, sans-serif; color:#666699 }
span.purple {font-weight: bold; color: #666699; font-family: Arial, Helvetica, sans-serif; font-size: 10pt}
span.small {font-size: 8pt; font-family: Arial, Helvetica, sans-serif; color:#333333 }
span.link {font-size: 8pt; font-family: Arial, Helvetica, sans-serif; color:#666699 }
</style>

</head>

<body bgcolor="#ffffff">
<a name="top"></a>
<table border="0" cellpadding="0" cellspacing="0" width="611">
<tr>
<td colspan="3" bgcolor="#cccccc" width="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" border="0" alt="image"></td>
</tr>

<tr>
<td bgcolor="#cccccc" width="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" border="0" alt="image"></td>

<td>
<table border="0" cellpadding="0" cellspacing="0" width="611">
<tr>
<td colspan="2"><a href="http://bulkmail2.sun.com/CTServlet?id=1043278657846"><img src="http://developer.java.sun.com/images/headers/core_ttips_hdr.jpg" width="611" height="160" alt="Core Java Technologies Technical Tips" border="0"></a></td>
</tr>

<tr>
<td colspan="2" bgcolor="#cccccc" width="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" border="0" alt="image"></td>
</tr>

<!-- ================== -->
<!-- Start Main Content -->
<!-- ================== -->

<tr>
<td height="20">&nbsp;&nbsp;&nbsp;<a href="http://bulkmail2.sun.com/CTServlet?id=1043278657868" style="text-decoration:none;">View this issue as simple text</a></td>
<td align="right" height="20"><span class="purple">January 22, 2003</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>

<tr><td colspan="2">

<FORM METHOD="GET" ACTION="http://search.java.sun.com/search/java/">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td>
        
<table border="0" cellpadding="3" cellspacing="0" width="100%">
<tr> 
<td align="left" VALIGN="middle" width="20%"><h3>In this Issue</h3></td>
              
<td valign="middle" align="right" width="70%">
<font size="2">
<INPUT TYPE="text" SIZE="15" MAXLENGTH="128" NAME=qt></FONT></td>
            
<td VALIGN="middle" WIDTH="55">
<INPUT TYPE="image" SRC="http://developer.java.sun.com/images/v4a_search.gif" ALT="Search" value="search" BORDER="0" WIDTH="55"></td>
</tr>
</table>

</FORM>

<p>
Welcome to the Core Java<font size="-2"><sup>TM</sup></font> Technologies Tech Tips, January 22, 2003. Here you'll get tips on using core Java technologies and APIs, such as those in Java 2 Platform, Standard Edition (J2SE<font size="-2"><sup>TM</sup></font>).
</p>

<p>
This issue covers:
</p>

<p>
<a href="#1"><img src="http://developer.java.sun.com/images/anchor.gif" border="0" alt="">Reading files from Java Archives (JARs)</a>
<br>    
<a href="#2"><img src="http://developer.java.sun.com/images/anchor.gif" border="0" alt="">Getting Started with the Java<font size="-2"><sup>TM</sup></font> Management Extensions (JMX<font size="-2"><sup>TM</sup></font>)</a>
</p>

<p>
These tips were developed using Java 2 SDK, Standard Edition, v 1.4. 
</p>

<p>
This issue of the Core Java Technologies Tech Tips is written by John Zukowski, president of <a href="http://www.jzventures.com">JZ Ventures, Inc.</a> 
</p>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">

<!-- Grey Horizontal Line Begins Here -->

<tr>
<td bgcolor="#cccccc" height="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td>
</tr>
</table> 

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">

<!-- Grey Horizontal Line Begins Here -->

<tr>
<td bgcolor="#cccccc" height="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td>
</tr>
</table> 

<!-- Grey Horizontal Line ends Here -->

<a name="1"></a>

<h3>READING FILES FROM JAVA ARCHIVES (JARS)</h3>

<p>
Java archive (JAR) files are the standard way of packaging Java technology-based solutions. They allow a developer to package all relevant content (.class, image, sound, and support files) in a single file. The JAR format supports compression, authentication, and versioning, among many other features.
</p>

<p>
Getting files out of JAR files can be a tricky task, but it doesn't have to be. This tip shows you how to get a file out of a JAR file, by first getting a directory of files in the JAR file, and then pulling out a specific one. 
</p>

<p>
If you are familiar with the popular ZIP format, JAR files aren't much different. JAR files provide a way of packaging multiple files into one, where each file may be compressed separately. What the JAR file adds is something called a manifest which allows a developer to provide additional information about the content. For example, the manifest can indicate which file in the JAR file to run to start an application, or the version of a library.
</p>

<p>
The Java 2 SDK, Standard Edition provides a jar tool that allows you to read and write JAR files from the console. However there might be times when you need to read and write JAR files from within your programs. (This tip will only cover reading JAR files from within a program.) The good news is that you can do this, and you don't have to worry about the decompression, because the library handles it for you. The classes you need are in the <code>java.util.jar package</code>. The main class here is <code>JarFile</code> which is a reference to the <code>.jar</code> file itself. Each individual file within the bigger file is referenced by a <code>JarEntry</code>.
</p>

<p>
To get started, you create a <code>JarFile</code> instance by passing the location to the constructor. This could be in the form of a String or a File:
</p>

<pre>
    JarFile jarFile = new JarFile(&quot;thefile.jar&quot;);
</pre>

<p>
or
</p>

<pre>
    File file = new File(&quot;thefile.jar&quot;);
    JarFile jarFile = new JarFile(file);
</pre>

<p>
There are other constructors for authentication support and marking the file for deletion. However those constructors will not be covered here.
</p>

<p>
After you have a reference to the JAR file, you can read the directory of its contents. The entries method of <code>JarFile</code> returns an <code>Enumeration</code> of all the entries. From each entry, you can then get its attributes from the manifest file, any certificate information, and any other information specific to the entry such as its name or size.
</p>

<pre>
  Enumeration enum = jarFile.entries();
  while (enum.hasMoreElements()) {
    process(enum.nextElement());
  }
</pre>

<p>
As previously mentioned, each individual entry is a <code>JarEntry</code>. This class has methods such as <code>getName</code>, <code>getSize</code>, and <code>getCompressedSize</code>.
</p>

<p>
Let's illustrate how to use these features in a program. The following program displays the name, size, and compressed size of the contents of a JAR file you specify. (This is similar to what the jar command does when you specify it with the &quot;t&quot; and &quot;v&quot; options.)
</p>

<pre>
   import java.io.*;
   import java.util.*;
   import java.util.jar.*;

   public class JarDir {
     public static void main (String args[]) 
         throws IOException {
       if (args.length != 1) {
         System.out.println(
            &quot;Please provide a JAR filename&quot;);
         System.exit(-1);
       }
       JarFile jarFile = new JarFile(args[0]);
       Enumeration enum = jarFile.entries();
       while (enum.hasMoreElements()) {
         process(enum.nextElement());
       }
     }

     private static void process(Object obj) {
       JarEntry entry = (JarEntry)obj;
       String name = entry.getName();
       long size = entry.getSize();
       long compressedSize = entry.getCompressedSize();
       System.out.println(
           name + &quot;\t&quot; + size + &quot;\t&quot; + compressedSize);
     }
   }
</pre>

<p>
If you run the <code>JarDir</code> program with the <code>jce.jar</code> file that comes with J2SE 1.4.1, you should see output that looks something like this (with more files shown where the ... is):
</p>

<pre>
META-INF/MANIFEST.MF    5315    1910
META-INF/4JCEJARS.SF    5368    1958
META-INF/4JCEJARS.DSA   2207    1503
META-INF/       0       2
javax/  0       0
javax/crypto/   0       0
javax/crypto/interfaces/        0       0
javax/crypto/interfaces/DHKey.class     209     185
javax/crypto/interfaces/DHPublicKey.class       265     215
javax/crypto/interfaces/DHPrivateKey.class      267     215
javax/crypto/interfaces/PBEKey.class    268     224
javax/crypto/SecretKey.class    167     155
...
</pre>

<p>
Notice the META-INF lines at the start of the output. This is the manifest and security certificate information. The entries with a 0 size are not files, but rather directories.
</p>

<p>
To actually read a specific file from a JAR file, you must get the <code>InputStream</code> for the entry. This is different than the <code>JarEntry</code>. That's because the <code>JarEntry</code> only contains information about the entry, not the actual contents of that entry. This is similar to the distinction between <code>File</code> and <code>FileInputStream</code>. Accessing <code>File</code> never opens the file, it just reads the information about it from the directory. Here's how to get the <code>InputStream</code> for the entry:
</p>

<pre>
   InputStream input = jarFile.getInputStream(entry);
</pre>

<p>
After you have an input stream, you can just read it like any other stream. In the case of a text stream, remember to use a <code>Reader</code> to get characters from the stream. For byte-oriented streams such as image files, just read directly. 
</p>

<p>
The following program demonstrates reading from a JAR file. Call the program with the name of a JAR file followed by the file name to read. The file to be read must have a text file type.
</p>

<pre>
   import java.io.*;
   import java.util.jar.*;

   public class JarRead {
     public static void main (String args[]) 
         throws IOException {
       if (args.length != 2) {
         System.out.println(
           &quot;Please provide a JAR filename and file to read&quot;);
         System.exit(-1);
       }
       JarFile jarFile = new JarFile(args[0]);
       JarEntry entry = jarFile.getJarEntry(args[1]);
       InputStream input = jarFile.getInputStream(entry);
       process(input);
     }

     private static void process(InputStream input) 
         throws IOException {
       InputStreamReader isr = 
      new InputStreamReader(input);
       BufferedReader reader = new BufferedReader(isr);
       String line;
       while ((line = reader.readLine()) != null) {
         System.out.println(line);
       }
       reader.close();
     }
   }
</pre>

<p>   
Suppose you had a text file named <code>spider.txt</code> in a JAR file named <code>myfiles.jar</code>. Suppose too that spider.txt contained the following text:
</p>

<pre>
   The itsy bitsy spider 
   Ran up the water spout
   Down came the rain and
   Washed the spider out 
</pre>

<p>
You could display the contents of the text file from the JAR file like this:
</p>

<pre>
   java JarRead myfiles.jar spider.txt   
</pre>

<p>
For more about JAR files, see the <a href="http://bulkmail2.sun.com/CTServlet?id=1043278657778">JAR file specification</a>.
</p>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="right">
<a href="#top">back to top<img src="http://developer.java.sun.com/images/back_to_top.gif" border="0" alt="image"></a>
</div>
</td></tr>

<tr><td bgcolor="#ffffff" height="2"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td></tr>

<!-- Grey Horizontal Line Begins Here -->

<tr>
<td bgcolor="#cccccc" height="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td>
</tr>
</table> 

<!-- Grey Horizontal Line ends Here -->

<a name="2"></a>

<h3>GETTING STARTED WITH THE JAVA MANAGEMENT EXTENSIONS (JMX)</h3>

<p>
The Java Management Extensions (JMX) offers a framework for the management and monitoring of resources. It is not yet a standard part of the Java 2 Standard Edition, but the reference implementation works with J2SE 1.4 and is a part of the Java<font size="-2"><sup>TM</sup></font> 2 Enterprise Edition (J2EE<font size="-2"><sup>TM</sup></font>) 1.4 specification currently in beta.
</p>

<p>
The purpose of JMX is to manage and monitor resources. Resources can be physical, for example small network devices, or logical, for example installed applications. You define the pieces in objects called <code>MBeans</code>. These objects contain the managable resources. The resources could be something like JavaBean component properties. The <code>MBeans</code> are then exposed to JMX agents. The agents know how to get the state of the resources through <code>MBeans</code>, and are permitted to change them if exposed in a writable fashion. The agents are then accessible through a distributed layer, typically through a client using HTML or the Simple Network Management Protocol (SNMP). This allows you to control the settings of the devices without having to run to equipment closets or create custom management tools for applications.
</p>

<p>
This tip isn't meant to present a complete discussion of the how and why of the JMX architecture. Instead, it's designed to give you a quick, &quot;hands-on&quot; information about using JMX over the lifetime of a program. To get started, you need the binaries for the JMX version 1.2 reference implementation. You can download the binaries from the <a href="http://bulkmail2.sun.com/CTServlet?id=1043278657792">JMX home page</a>. There is just one version for all platforms. Unpack the files into a working directory. 
</p>

<p>
There are two JAR files in the download: <code>lib/jmxri.jar</code> and <code>lib/jmxtools.jar</code>. The <code>jmxri.jar</code> file represents the reference implementation. These are the standard JMX classes, and can be found in the <code>javax.management</code> package. The <code>jmxtools.jar</code> file is the JMX toolkit. These represent unsupported classes that Sun provides for development. Both of these JAR files will need to be in your <code>CLASSPATH</code>. For simplicity sake, just copy these to the <code>jre/lib/ext</code> directory under the installation directory for your Java Runtime Environment (JRE).
</p>

<p>
If your JRE directory is <code>C:\j2sdk1.4.1\jre\lib\ext</code>, then the copy command would be as follows:
</p>

<pre>
copy lib\*.jar \j2sdk1.4.1\jre\lib\ext
</pre>

<p>
(If you don't want these available after this tip, remember to remove the files from the <code>jre\lib\ext</code> directory when done.)
</p>

<p>
Next, let's define an interface for the operations you want the <code>MBean</code> to perform. Typically, custom interfaces are used, but aren't required. However, they make things simpler as you move into more complicated JMX behaviors, so let's use one here. (If you don't create a custom interface, you must implement <code>javax.management.DynamicMBean</code>.) The <code>MBean</code> will have one read-write resource to manage (a message). It will also have a read-only counter of the number of times that resource changed, and a reset mechanism to reinitialize the counter value. (Imagine counting the number of IP addresses a network box had over the course of a week.) Here's the definition of the interface:
</p>

<pre>
   public interface HelloMBean {
     public String getMessage();
     public void setMessage(String message);
     public int getChangeCount();
     public void resetCounter();
   }
</pre>

<p>
The first three methods look like they access JavaBean component properties (called &quot;attributes&quot; in JMX). In fact, they do access properties. The last method is simply a random method thrown in to show that everything defined in the interface doesn't have to be property-related. JMX supports executing any method, not just the getting and setting of properties.
</p>

<p>
The implementation of this interface is rather simple:
</p>

<pre>
   public class Hello implements HelloMBean {
     private String message;
     private int changeCount;
  
     public String getMessage() {
       return message;
     }
  
     public void setMessage(String message){
       this.message = message;
       changeCount++;
     }
  
     public int getChangeCount() {
       return changeCount;
     }
  
     public void resetCounter() {
       changeCount = 0;
     }
   }
</pre>  

<p> 
Notice the naming convention of the concrete class. The interface name follows the name of <code>[ClassName]MBean</code>, so the class is just <code>[ClassName]</code>, replacing <code>[ClassName]</code> with the specific name. This is similar to the naming convention of getter and setter methods for attributes.   
</p>

<p>
So far, you haven't seen any JMX-specific code, but that is about to change. The <code>MBean</code> Server needs to communicate with the <code>MBeans</code>. That communication is done by registering various agents with the server. Then, anyone using an appropriate client interface can execute any of the methods of the exposed interface, in this case, <code>HelloMBean</code>.
</p>

<p>
The <code>MBean</code> server is aptly named <code>MBeanServer</code>. You get the server from the <code>MBeanServerFactory</code>. You can either name your server or call <code>createMBeanServer</code> with no arguments to get the default domain.
</p>

<pre>
   MBeanServer server = 
      MBeanServerFactory.createMBeanServer();
</pre>

<p>
Next, you register your <code>MBeans</code> with the server. Each bean is registered in the form <code>domain:key1=XXX1,key2=XXX2</code>, where <code>key1</code> is an attribute name and <code>XXX</code> is the associated value (and domain is replaced by the domain name). Think of it like naming an instance of a class. Before the <code>:</code>, the domain names a unique namespace for the instances. Typically, these are named similar to packages to ensure uniqueness, using reverse DNS names (for example, <code>com.sun.java</code>).
</p>

<p>
So, if you wanted to create and register two <code>MBeans</code> named <code>hello1</code> and <code>hello2</code>, of type Hello, you could use the following code:
</p>

<pre>
   HelloMBean hello1 = new Hello();
   ObjectName helloObjectName = new ObjectName(
     &quot;HelloServer:type=Hello,name=hello1&quot;);
   server.registerMBean(hello, helloObjectName);
   HelloMBean hello2 = new Hello();
   ObjectName helloObjectName2 = new ObjectName(
     &quot;HelloServer:type=Hello,name=hello2&quot;);
   server.registerMBean(hello2, helloObjectName2);
</pre>

<p>
For simplicity, the domain name here is just <code>HelloServer</code>, because there is no chance of conflicts in the example. 
</p>

<p>
A program with this much in it would be sufficient to support JMX. However, you wouldn't be able to see much. To see something more, you need a client interface. However instead of providing your own client interface, use the <code>jmxtools.jar</code> part of the download.
</p>

<p>
Within <code>jmxtools.jar</code> is the <code>HtmlAdaptorServer</code>. This gives you an HTML view into the <code>MBean</code> server. You need to create and register the server just like a regular <code>MBean</code>. However there is one exception: you have to tell the server what port to listen on. This example uses port 8082. If this port is not available for you, choose another and make the necessary code changes. Then, you can connect the HTML adaptor to the <code>MBean</code> server and access the <code>MBeans</code>.
</p>

<pre>
   HtmlAdaptorServer adapterServer = 
     new HtmlAdaptorServer();
   ObjectName adapterObjectName = new ObjectName(
      &quot;HelloServer:name=htmladapter,port=8082&quot;);
   adapterServer.setPort(8082);
   server.registerMBean(
      adapterServer, adapterObjectName);
   adapterServer.start();
</pre>

<p>
The complete server program follows, with explicit catching of all the possible exceptions:
</p>

<pre>
 import com.sun.jdmk.comm.*;
 import javax.management.*;

 public class HelloAgent {
    public static void main(String args[]) {
     MBeanServer server = 
       MBeanServerFactory.createMBeanServer();
     HtmlAdaptorServer adaptorServer = 
        new HtmlAdaptorServer();
     HelloMBean hello1 = new Hello();
     HelloMBean hello2 = new Hello();
     try {
       ObjectName helloObjectName1 = new ObjectName(
         &quot;HelloServer:type=Hello,name=hello1&quot;);
       server.registerMBean(hello1, helloObjectName1);
       ObjectName helloObjectName2 = new ObjectName(
         &quot;HelloServer:type=Hello,name=hello2&quot;);
       server.registerMBean(hello2, helloObjectName2);
       ObjectName adaptorObjectName = new ObjectName(
          &quot;HelloServer:type=htmladaptor,port=8082&quot;);
       adaptorServer.setPort(8082);
       server.registerMBean(
          adaptorServer, adaptorObjectName);
       adaptorServer.start();
     } catch (MalformedObjectNameException e) {
       System.out.println(&quot;Bad object name&quot;);
       e.printStackTrace();
     } catch (InstanceAlreadyExistsException e) {
       System.out.println(&quot;Already exists&quot;);
       e.printStackTrace();
     } catch (MBeanRegistrationException e) {
       System.out.println(&quot;Registration problems&quot;);
       e.printStackTrace();
     } catch (NotCompliantMBeanException e) {
       System.out.println(&quot;Registration problems&quot;);
       e.printStackTrace();
     }
   }
 }
</pre>

<p>
You should now compile the three classes and run the <code>HelloAgent</code> program:
</p>

<pre>
javac HelloMBean.java Hello.java HelloAgent.java
java HelloAgent
</pre>

<p>
The <code>HelloAgent</code> program will not return. It is running the application, including maintaining the current state of your <code>MBeans</code>. To access the server you can use any HTML client to connect to the appropriate port. To manage the agent, point your browser to <code>http://localhost:8082/</code>.
</p>

<p>
Your browser should display a screen that lists the <code>HelloServer</code> and its three <code>MBeans</code> (two Hello beans and the HTML adaptor):
</p>

<ul>
<li><code>hello1</code></li>
<li><code>hello2</code></li>
<li><code>htmladapter</code></li>
</ul>

<p>
<img src="http://developer.java.sun.com/developer/JDCTechTips/images/tt012203_screen1.gif" alt="" border="1">
</p>

<p>
Clicking on one of the beans allows you to change or monitor its settings. 
</p>

<p>
<img src="http://developer.java.sun.com/developer/JDCTechTips/images/tt012203_screen2.gif" alt="" border="1">
</p>

<p>
To demonstrate, try changing the message property and watch the change count increase. 
</p>

<p>
<img src="http://developer.java.sun.com/developer/JDCTechTips/images/tt012203_screen3.gif" alt="" border="1">
</p>

<p>
Also clear the change count.
</p>

<p>
Clicking on the <code>MBeanServerDelegate</code> bean will show you information about the server.
</p>

<p>
<img src="http://developer.java.sun.com/developer/JDCTechTips/images/tt012203_screen4.gif" alt="" border="1">
</p>

<p>
There is much more to JMX than what this tip covered. This tip was designed to get you started so you can see how you might configure and monitor your Java solutions when they are deployed. Instead of developing custom solutions for exposing the management interface to the system configuration, simply use JMX.
</p>

<p>
For more information about JMX, and for access to other JMX resources, visit the <a href="http://bulkmail2.sun.com/CTServlet?id=1043278657792">JMX home page</a>. 
</p>

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">

<tr>
<td>
<div align="right">
<a href="#top">back to top<img src="http://developer.java.sun.com/images/back_to_top.gif" border="0" alt="image"></a>
</div>
</td></tr>

<tr><td bgcolor="#ffffff" height="2"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td></tr>

<!-- Grey Horizontal Line Begins Here -->

<tr>
<td bgcolor="#cccccc" height="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td>
</tr>
</table> 

<!-- Grey Horizontal Line ends Here -->


<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#ffffff" height="2"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td></tr>

<h3>Reader Feedback</h3> 
<FORM METHOD="POST" ACTION="http://developer.java.sun.com/servlet/jdc.survey.TabulationServlet">
<INPUT TYPE="hidden" NAME="survey_id" VALUE="2600">
<INPUT TYPE="hidden" NAME="anonymous" VALUE="True">
<INPUT TYPE="hidden" NAME="answer_count" VALUE="3">
<INPUT TYPE="hidden" NAME="answer1" VALUE="JanCore_tt0122"> 
<INPUT NAME="answer2" TYPE="RADIO" VALUE="2">&nbsp; Very worth reading&nbsp; 
<INPUT NAME="answer2" TYPE="RADIO" VALUE="1">&nbsp; Worth reading&nbsp; 
<INPUT NAME="answer2" TYPE="RADIO" VALUE="0">&nbsp; Not worth reading&nbsp; 
 
<p>
If you have other comments or ideas for future technical tips, please type them  here: 
</p>
 
<p>
<TEXTAREA NAME="answer3" ROWS="6" COLS="50"></TEXTAREA> 
</p>
 
<p>
<INPUT TYPE="SUBMIT" VALUE="Submit"> &nbsp; <INPUT TYPE="RESET"> 
</p>

<p> 
Have a question about Java<font size="-2"><sup>TM</sup></font> programming? Use  
<a href="http://bulkmail2.sun.com/CTServlet?id=1043278657882">Java Online Support.</a> 
</p>

</td></tr></table>
</FORM> 

<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="right">
<a href="#top">back to top<img src="http://developer.java.sun.com/images/back_to_top.gif" border="0" alt="image"></a>
</div>
</td></tr>

<tr><td bgcolor="#ffffff" height="2"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td></tr>

<!-- Grey Horizontal Line Begins Here -->

<tr>
<td bgcolor="#cccccc" height="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" ALT="Pixel" border="0"></td>
</tr>
</table> 

<!-- Grey Horizontal Line ends Here -->

<br>

<span class="small">IMPORTANT: Please read our Terms of Use, Privacy, and Licensing 
policies:<br>
<a href="http://www.sun.com/share/text/termsofuse.html"><span class="link">http://www.sun.com/share/text/termsofuse.html</span></a><br>
<a href="http://www.sun.com/privacy/"><span class="link">http://www.sun.com/privacy/</span></a><br> 
<a href="http://developer.java.sun.com/berkeley_license.html"><span class="link">http://developer.java.sun.com/berkeley_license.html</span></a>
</span><br><br>


<span class="small">
Comments? Send your feedback on the Core Java<sup>TM</sup> Technologies Tech Tips to: <a href="mailto:jdc-webmaster@sun.com"><span class="link">jdc-webmaster@sun.com</span></a>
</span><br><br>

<span class="small">
Subscribe to other Java developer Tech Tips:
</span><br><br>

<span class="small">
- Enterprise Java Technologies Tech Tips. Get tips on using enterprise Java technologies and APIs, such as those in the Java 2 Platform, Enterprise Edition (J2EE<sup>TM</sup>).<br>
- Wireless Developer Tech Tips. Get tips on using wireless Java technologies and APIs, such as those in the Java 2 Platform, Micro Edition (J2ME<sup>TM</sup>).<br><br>
</span>
   
<span class="small">
To subscribe to these and other JDC publications:<br>
- Go to the JDC Newsletters and Publications page, choose the newsletters you want to <a href="http://bulkmail2.sun.com/CTServlet?id=1043278657818"><span class="link">subscribe</span></a> to and click &quot;Update&quot;.<br>
  - To unsubscribe, go to the <a href="http://bulkmail2.sun.com/CTServlet?id=1043278657818"><span class="link">subscriptions page</span></a>, uncheck the appropriate checkbox, and click &quot;Update&quot;.
</span><br><br>

<span class="small">ARCHIVES: You'll find the Core Java Technologies Tech Tips archives at:<br>
<a href="http://bulkmail2.sun.com/CTServlet?id=1043278657899"><span class="link">http://java.sun.com/jdc/TechTips/index.html</span></a>
</span><br><br>

<span class="small">Copyright 2003 <a href="http://bulkmail2.sun.com/CTServlet?id=1043278657919"><span class="link">Sun Microsystems, Inc.</span></a> All rights reserved.
<br>901 San Antonio Road, Palo Alto, California 94303 USA.
</span><br><br>

<span class="small">This document is protected by copyright. For more information, see:
<br><a href="http://java.sun.com/jdc/copyright.html"><span class="link">http://java.sun.com/jdc/copyright.html</span></a>
</span><br><br>

<span class="small">Sun, Sun Microsystems, Java, Java Developer Connection, JMX, J2SE, J2EE, and J2ME are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.</span><br><br>


<!-- ================ -->
<!-- End Main Content -->
<!-- ================ -->

<center>
<a href="http://bulkmail2.sun.com/CTServlet?id=1043278657919"><img src="http://developer.java.sun.com/images/lgsun.gif" border="0" alt="Sun Microsystems, Inc."></a>
</center>

</td>
</tr>
</table>

</td></tr>
</table>
</td>

<td bgcolor="#cccccc" width="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" border="0" alt=""></td>
</tr>
<tr>
<td colspan="3" bgcolor="#cccccc" width="1"><img src="http://developer.java.sun.com/images/pixel.gif" width="1" height="1" border="0" alt=""></td>
</tr>
</table>

<table bgcolor = "#efefef"><tr><td><a href="http://bulkmail.sun.com/unsubscribe?28542086331453377">Please unsubscribe me from this newsletter.</a><img src="http://bulkmail2.sun.com/OTServlet?id=28542086331453377" width=1 height=1></td></tr></table></body>
</html>

