Some reader favorites:
EJB fundamentals and session beans
Create a scrollable virtual desktop in Swing
More action with Struts 2
In a recent review of Struts 2 in Action, JW Blogger Oleg Mikheev notes that Struts 2 is "just a collection of extensions built upon WebWork, which is ultimately
the right thing to learn before starting a Struts 2 project." While Struts 2 has some architectural flaws, Oleg calls WebWork
well-designed, well-tested, and reliable. What are your experiences using Struts 2 and WebWork?
Also see "Hello World the WebWork way," a JavaWorld excerpt from WebWork in Action, by Patrick Lightbody and Jason Carreira.
| Memory Analysis in Eclipse |
| Enterprise AJAX - Transcend the Hype |
NSClient4j is a pure Java API that provides simple and quick access to Windows Performance Monitor (WPM) statistics. These statistics prove invaluable for monitoring your Windows servers and providing a baseline for activities such as capacity planning and trouble shooting. Additionally, access to low-level performance or operating statistics can be useful in your low-level code, such as the current rate of GETS against your IIS (Internet Information Server) Web server.
In this article, the continuation of my series on WPM, I present a brief introduction to Java Management Extensions (JMX) and its benefits. I then explain how to implement JMX-based services for NSClient4j and describe different methods for implementing that technology.
As a brief aside, I want to enumerate some changes and enhancements that have been made in the NSClient4j package since Part 1 of this series:
com.marketwide.nagios to org.nsclient4j.
NSClient4j class as convenience methods:
getUsedDiskSpace(String diskVol)getFreeDiskSpace(String diskVol)getTotalDiskSpace(String diskVol)getUsedPercentDiskSpace(String diskVol)getFreePercentDiskSpace(String diskVol)NSClient4JException has been extended to differentiate between transport errors and WPM errors.
To provide a quick review of the NSClient4j functionality, the code below shows a few lines of Java code connecting to an NSClient server on a Windows host and acquiring the system's context-switch rate per second.
Listing 1. Source for CLStat, a simple NSClient4j example
public class CLStat {
public static void main(String[] args) {
try {
NSClient4j client = new NSClient4j("192.168.1.4", 1248);
System.out.println("Result:" + client.getPerfMonCounter("\\System\\Context Switches/sec"));
} catch (NSClient4JException e) {
System.err.println("Exception Geting Stat:" + e);
}
}
}
Listing 2. Run the CLStat example
c:\temp>set CLASSPATH=c:\nsclient4j-root\nsclient4j\dist\nsclient4j.jar;%CLASSPATH%
c:\temp>java org.nsclient4j.CLStat
Result:4120.66700
Now that we have reviewed the basics of NSClient4j, let's look at JMX and how it can be implemented to support NSClient4j.
The Java Management Extensions technology is a Java standard for building management and monitoring components for applications. Though NSClient4j provides a satisfactory low-level API for accessing WPM statistics (see Figure 1), a monitoring layer implemented in JMX provides both a higher standard of integration and compliance while significantly extending NSClient4j's functionality.
| Subject | Replies |
Last post
|
|
By JavaWorld |
0 |
10/30/07 12:17 PM
by Anonymous |
|
By |
0 |
05/24/07 05:09 PM
by Anonymous |