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

org.hibernate.event.service.spi.EventListenerGroup Maven / Gradle / Ivy

/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.event.service.spi;

import java.io.Serializable;

import org.hibernate.event.spi.EventType;

/**
 * Contract for a groups of events listeners for a particular event type.
 *
 * @author Steve Ebersole
 */
public interface EventListenerGroup extends Serializable {

	/**
	 * Retrieve the event type associated with this groups of listeners.
	 *
	 * @return The event type.
	 */
	public EventType getEventType();

	/**
	 * Are there no listeners registered?
	 *
	 * @return {@literal true} if no listeners are registered; {@literal false} otherwise.
	 */
	public boolean isEmpty();

	public int count();

	public Iterable listeners();

	/**
	 * Mechanism to more finely control the notion of duplicates.
	 * 

* For example, say you are registering listeners for an extension library. This extension library * could define a "marker interface" which indicates listeners related to it and register a strategy * that checks against that marker interface. * * @param strategy The duplication strategy */ public void addDuplicationStrategy(DuplicationStrategy strategy); public void appendListener(T listener); public void appendListeners(T... listeners); public void prependListener(T listener); public void prependListeners(T... listeners); public void clear(); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy