Moving right along... We have a roof, a door and some further siding.
Saturday, October 31, 2009
Wednesday, October 28, 2009
Shed Again
This new shed actually has its own smaller shed to one side of the door. I'm thinking of adding an additional smaller storage area to the small shed. And so on.
Posted by
Jeff Sexton
at
8:31 AM
0
comments
Monday, October 26, 2009
New Shed Internet Web Blog Posting Number III
This is actually from yesterday...
Posted by
Jeff Sexton
at
4:47 PM
0
comments
Saturday, October 24, 2009
Friday, October 23, 2009
Intercepting Log Messages in Glassfish
Image by Getty Images via Daylife
There weren't a lot of examples of this to be found, so here some code. First, the MBean itself. The MBean needs to be built in conformance with some simple but very specific rules.
- It must implement javax.management.NotificationListener
- It must have an interface of its own with the same name as the MBean, but ending in "MBean"
package com.log.monitor;It is a trivial Java Bean interface with one getter/setter pair added here just as an example. Here is the implementation class:
import javax.management.Notification;
import javax.management.NotificationListener;
public interface CustomActionMBean {
public int getA();
public void setA(int a);
}
package com.log.monitor;
import javax.management.Notification;
import javax.management.NotificationListener;
public class CustomAction implements CustomActionMBean, NotificationListener {
private int a = 0;
public CustomAction() {
}
public void setA(int a) {
this.a = a;
}
public int getA() {
return a;
}
public void handleNotification(Notification arg0, Object arg1) {
System.out.println("Called... " + arg0.getMessage());
}
}
These get built into a jar file called CutomAction.jar, using whatever IDE or command line you prefer. I used Eclipse, and I found that I had to uncheck the compression option to get this to fully work.I deployed the jar file to Glassfish using its web-based administration console. This is done in a manner simular to deploying anything else, but using the section under "custom mbeans." There is a command line method too, using asadmin. The deployment will fail if there's anything wrong with the MBean, such as an incorrect interface name or referring to the wrong Notification classes.
Once this is done, a Management Rule can be created. The key here is that the "event type" should be "log". The MBean deployed above should appear in the "Action" drop down list. Each event type has different options. In the case of a log type it is also possible to select a log level, and a specific logger as filters. But once activated, this rule will call the new MBean as needed when an appropriate log message is created. The raw message string is available from the Notification object with getMessage().
Here's a few good resources on all this:
http://weblogs.java.net/blog/sankara/archive/2006/02/self_management.html
http://blogs.sun.com/technical/entry/self_management_rules
https://glassfish.dev.java.net/javaee5/selfmanagement/selfmanagementhome.html
http://www.caucho.com/resin-3.0/jmx/tutorial/listener/index.xtp
Posted by
Jeff Sexton
at
7:26 AM
0
comments
Labels: Java
Thursday, October 22, 2009
Shed, Part One
A shed is going up in the little used corner of my backyard. I took these pictures this morning when there was a little moisture in the air, which was caught in the flash.
The shed is being built by Justin Swanson, the same contractor that did the work on the living room and bathroom a while back.
Posted by
Jeff Sexton
at
12:22 PM
0
comments
Subscribe to:
Posts (Atom)
WantedGood price paid for accumulations and estates of vintage mechanical watch and pocketwatch material and parts. Pre-quartz, pre-battery, Elgin and other American brands in particular, Swiss material less so. Note that I am a watchmaker working to keep the craft alive and well, I am not an antique dealer looking to buy and resell.Contact jsexton@agora.rdrop.com - Thanks! |
![Reblog this post [with Zemanta]](http://img.zemanta.com/reblog_e.png?x-id=96ebeb1f-ad83-4891-81a6-c59fd5983e9d)
