
com.vaadin.addon.jpacontainer.EntityProviderChangeNotifier Maven / Gradle / Ivy
/*
JPAContainer
Copyright (C) 2009-2011 Oy Vaadin Ltd
This program is available under GNU Affero General Public License (version
3 or later at your option).
See the file licensing.txt distributed with this software for more
information about licensing.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
package com.vaadin.addon.jpacontainer;
import java.io.Serializable;
/**
* Interface to be implemented by {@link EntityProvider}s that wish to notify
* clients (in practice EntityContainers) when their contents change.
*
* The EntityProvider should at least notify its listeners of the following events:
*
*
* - An entity is added to the entity provider
* - An already existing entity is updated
* - An entity is removed from the entity provider
* - The contents of the entity provider is changed completely
*
*
* This is useful in situations where several EntityContainers share the same
* entity provider.
*
*
* @author Petter Holmström (Vaadin Ltd)
* @since 1.0
*/
public interface EntityProviderChangeNotifier extends Serializable {
/**
* Registers listener
to be notified of
* {@link EntityProviderChangeEvent}s.
*
* @param listener
* the listener to register (must not be null).
*/
public void addListener(EntityProviderChangeListener listener);
/**
* Removes the previously registered listener.
*
* @param listener
* the listener to remove (must not be null).
*/
public void removeListener(EntityProviderChangeListener listener);
}