Issue Details (XML | Word | Printable)

Key: GLASSFISH-17085
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Byron Nevins
Reporter: Tom Mueller
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
glassfish

Provide way to write monitoring listener without modifying framework classes

Created: 21/Jul/11 01:59 PM   Updated: 10/Aug/11 08:35 PM
Component/s: monitoring
Affects Version/s: 3.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Source File XYZListener.java (3 kB) 21/Jul/11 06:21 PM - Tom Mueller

Issue Links:
Dependency
 

Tags:
Participants: Byron Nevins and Tom Mueller


 Description  « Hide

When writing an monitoring listener by extending the ProbeProviderEventListener class, it becomes necessary to modify the framework's ProbeClientInvokerFactory class to add a create*Invoker method that increments the AtomicInteger that is contained in that class.

This RFE is for modifying the flashlight framework so that it is possible to create a ProbeProviderEventListener and add it to the system without having to modify any of the framework classes.



Byron Nevins added a comment - 21/Jul/11 05:38 PM

ProbeProviderEventListener is an interface not a class. You don't extend it you implement it.

Can you give more details?
What exactly do you want?

How about:
1) Sample Code for how you have to do it now.
2) Sample Code for how you would like to do it instead.


Tom Mueller added a comment - 21/Jul/11 06:21 PM

Please see the attached file, XYZListener.java, for sample code that implements the ProbeProviderEventListener interface. In the probeProviderAdded method, there is a call to p.addInvoker(ProbeClientInvokerFactory.createXYZInvoker(p)

The code for the createXYZInvoker method is the following:

public static ProbeClientInvoker createXYZInvoker(FlashlightProbe probe) { int invokerId = clientMethodIdCounter.incrementAndGet(); return new XYZListener.XYZProbeClientInvoker(invokerId, probe); }

Maybe there is a way to get an invokerId without using the clientMethodIdCounter that is a private member of ProbeClientInvokderFactory, but I didn't see one.