Example usage for javax.management.timer Timer addNotificationListener

List of usage examples for javax.management.timer Timer addNotificationListener

Introduction

In this page you can find the example usage for javax.management.timer Timer addNotificationListener.

Prototype

public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) 

Source Link

Document

Adds a listener.

Usage

From source file:org.accada.epcis.repository.query.QuerySubscriptionScheduled.java

/**
 * Starts a Timer to get this query executed in specific time intervals.
 * /*  w  ww  . j a v  a 2 s.  c  o  m*/
 * @throws ImplementationException
 *             If the next scheduled date cannot be evaluated.
 */
private void startThread() throws ImplementationExceptionResponse {
    Timer nextAction = new Timer();
    nextAction.addNotificationListener(this, null, nextAction);

    Date nextSchedule = schedule.nextScheduledTime().getTime();
    nextAction.addNotification("SubscriptionSchedule", "Please do the query", null, nextSchedule);
    nextAction.start();
}