@header@
Comment Listeners

Comment listeners are a type of Pebble plugin that allow you to write code that is called whenever a comment is added or removed. The following comment listeners are included with the Pebble distribution.

  • pebble.event.comment.EmailNotificationListener - sends a notification e-mail when a new comment is added.

To write your own listener, you need to write a Java class that implements the pebble.event.comment.CommentListener interface as shown below. To gain access to the associated comment, simply use the getComment() method on the pebble.event.comment.CommentEvent object that is passed to the callback methods.

  package pebble.event;

  /**
   * Implemented by classes wanting to be notified of comment events.
   *
   * @author Simon Brown
   */
  public interface CommentListener {

    /**
     * Called when a comment has been added.
     *
     * @param event   a CommentEvent instance
     */
    public void commentAdded(CommentEvent event);

    /**
     * Called when a comment has been removed.
     *
     * @param event   a CommentEvent instance
     */
    public void commentRemoved(CommentEvent event);

  }

@footer@