JPPF Issue Tracker
star_faded.png
Please log in to bookmark issues
feature_request_small.png
CLOSED  Feature request JPPF-432  -  Extension point: driver statistics listener
Posted Jan 26, 2016 - updated Jan 31, 2016
action_vote_minus_faded.png
0
Votes
action_vote_plus_faded.png
icon_info.png This issue has been closed with status "Closed" and resolution "RESOLVED".
Issue details
  • Type of issue
    Feature request
  • Status
     
    Closed
  • Assigned to
     lolo4j
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
  • Posted by
     lolo4j
  • Owned by
    Not owned by anyone
  • Category
    Server
  • Resolution
    RESOLVED
  • Priority
    Normal
  • Targetted for
    icon_milestones.png JPPF 5.2
Issue description
We propose to expose to JPPF developers the ablity to register listeners for changes in the driver's statistics. In fact, the code is already there, but only used internally. Currently the listener interface and the event class are as follows:
public interface JPPFStatisticsListener extends EventListener {
  // Called when a new snapshot is created
  void snapshotAdded(JPPFStatisticsEvent event);
 
  // Called when a snapshot is removed
  void snapshotRemoved(JPPFStatisticsEvent event);
 
  // Called when a snapshot is updated
  void snapshotUpdated(JPPFStatisticsEvent event);
}
 
public class JPPFStatisticsEvent extends EventObject {
  // Initialize this event with the specified source snapshot
  public JPPFStatisticsEvent(final JPPFSnapshot snapshot) {
    super(snapshot);
  }
 
  // Get the snapshot source of this event
  public JPPFSnapshot getSnapshot() {
    return (JPPFSnapshot) getSource();
  }
}
Unless we want to expose more details, all that remains to do is expose the listener interface and event class and add discovery via SPI on the listener interface

#2
Comment posted by
 lolo4j
Jan 31, 22:50
Implemented in trunk revision 3949