All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.terracotta.management.resource.services.events.EventServiceV2 Maven / Gradle / Ivy

Go to download

Ehcache is an open source, standards-based cache used to boost performance, offload the database and simplify scalability. Ehcache is robust, proven and full-featured and this has made it the most widely-used Java-based cache.

There is a newer version: 2.10.9.2
Show newest version
/*
 * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved.
 */
package org.terracotta.management.resource.services.events;

import org.terracotta.management.resource.events.EventEntityV2;

/**
 * An interface for registering topology event listeners.

 * @author Ludovic Orban
 */
public interface EventServiceV2 {

  /**
   * The interface that must be implemented by event listeners.
   */
  interface EventListener {
    /**
     * Event callback.
     * @param eventEntity the event.
     */
    void onEvent(EventEntityV2 eventEntity);

    /**
     * Error callback.
     * @param throwable a throwable representing the error.
     */
    void onError(Throwable throwable);
  }

  /**
   * Register a listener for event notifications.
   *
   * @param listener the listener.
   * @param localOnly if only local events should be listened to, in case the event source can aggregate multiple sources.
   */
  void registerEventListener(EventListener listener, boolean localOnly);

  /**
   * Unregister a previously registered listener.
   *
   * @param listener the listener.
   */
  void unregisterEventListener(EventListener listener);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy