glassfish
  1. glassfish
  2. GLASSFISH-17085

Provide way to write monitoring listener without modifying framework classes

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.1
    • Fix Version/s: None
    • Component/s: monitoring
    • Labels:
      None

      Description

      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.

        Issue Links

          Activity

          Tom Mueller created issue -
          Hide
          Byron Nevins added a comment -

          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.

          Show
          Byron Nevins added a comment - 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.
          Hide
          Tom Mueller added a comment -

          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.

          Show
          Tom Mueller added a comment - 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.
          Tom Mueller made changes -
          Field Original Value New Value
          Attachment XYZListener.java [ 46747 ]
          Jennifer Chou made changes -
          Link This issue blocks GLASSFISH-17182 [ GLASSFISH-17182 ]

            People

            • Assignee:
              Byron Nevins
              Reporter:
              Tom Mueller
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: