E - the BackendUpdatedEvent that this backend fires.public abstract class AbstractBackend<E extends BackendUpdatedEvent> extends Object implements Backend<E>
| Constructor and Description |
|---|
AbstractBackend() |
| Modifier and Type | Method and Description |
|---|---|
void |
addBackendListener(BackendListener<E> listener)
Registers a listener that get called whenever a backend changes.
|
protected void |
fireBackendUpdated(E e)
Notifies all registered listeners when the backend has been updated.
|
protected void |
fireEvent(ProtempaEvent evt) |
protected void |
fireUnrecoverableError(UnrecoverableBackendErrorEvent e)
Notifies all registered listeners when an unrecoverable error has
occurred in a backend.
|
String |
getConfigurationsId() |
String |
getId() |
void |
initialize(BackendInstanceSpec<?> config)
Initializes the backend from a
BackendInstanceSpec. |
void |
removeBackendListener(BackendListener<E> listener)
Unregisters a listener so that changes to the backend are no longer sent.
|
void |
setEventListeners(List<? extends ProtempaEventListener> eventListeners) |
void |
setId(String id) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getDisplayNamepublic void initialize(BackendInstanceSpec<?> config) throws BackendInitializationException
BackendBackendInstanceSpec. It is called
for you by BackendInstanceSpec.getInstance(), but if you
create a Backend object yourself, you must call this manually
before using it.initialize in interface Backend<E extends BackendUpdatedEvent>config - the configuration Properties object.BackendInitializationExceptionpublic String getId()
getId in interface Backend<E extends BackendUpdatedEvent>public void setId(String id)
public String getConfigurationsId()
getConfigurationsId in interface Backend<E extends BackendUpdatedEvent>public void addBackendListener(BackendListener<E> listener)
BackendaddBackendListener in interface Backend<E extends BackendUpdatedEvent>listener - a BackendListener.public void removeBackendListener(BackendListener<E> listener)
BackendremoveBackendListener in interface Backend<E extends BackendUpdatedEvent>listener - a BackendListener.public void setEventListeners(List<? extends ProtempaEventListener> eventListeners)
setEventListeners in interface Backend<E extends BackendUpdatedEvent>protected void fireEvent(ProtempaEvent evt)
protected void fireBackendUpdated(E e)
e - a BackendUpdatedEvent representing an update.protected void fireUnrecoverableError(UnrecoverableBackendErrorEvent e)
e - a UnrecoverableBackendErrorEvent representing the
cause of the error.Copyright © 2012–2017 Emory University. All rights reserved.