users@glassfish.java.net

Turning off a Probe

From: Vince Kraemer <vince.kraemer_at_oracle.com>
Date: Fri, 01 Oct 2010 10:22:43 -0700

I was reading through this entry
http://blogs.sun.com/foo/entry/mort_learns_how_to_use and wanted to
extend the app a bit to do some 'benchmarking'...

I figured out that the call to listenerRegistrar.registerListener(new
MyProbeListener()) is what 'starts' listening.

I want to change the app to do the following...

1. call myProbe about a million times, THEN
2. register the probe listener, THEN
3. call myProbe about a million times, THEN
4. unregister the probe listener, THEN
5. call myProbe about a million times

so I can compare the time taken at step 1, 3, and 5.

I expect 3(time) > 1(time) and 3(time) > 5(time) and 1(time) to be
approximately equal to 5(time)

But, I do not see a way to unregister the listener.

Is there a way to do this?

vbk