public final class AlgorithmSourceImpl extends AbstractSource<AlgorithmSourceUpdatedEvent,AlgorithmSourceBackend,AlgorithmSourceUpdatedEvent,AlgorithmSourceBackendUpdatedEvent> implements AlgorithmSource
AlgorithmSourceBackend provide implementations of the actual
algorithms available.| Constructor and Description |
|---|
AlgorithmSourceImpl(AlgorithmSourceBackend[] backends)
Constructor for specifying a mix of
AlgorithmSourceBackends and
Properties objects specifying algorithm source backends. |
| Modifier and Type | Method and Description |
|---|---|
void |
backendUpdated(AlgorithmSourceBackendUpdatedEvent event)
Notifies a listener when it needs to reread data in the backend.
|
void |
clear() |
void |
close()
|
Algorithm |
readAlgorithm(String id)
Read an algorithm with the given id.
|
Set<Algorithm> |
readAlgorithms()
Reads all algorithms in this algorithm source.
|
addSourceListener, fireClosedUnexpectedly, fireSourceUpdated, getBackends, isClosed, removeSourceListener, setEventListeners, unrecoverableErrorOccurredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddSourceListener, getBackends, removeSourceListener, setEventListenersunrecoverableErrorOccurredpublic AlgorithmSourceImpl(AlgorithmSourceBackend[] backends)
AlgorithmSourceBackends and
Properties objects specifying algorithm source backends.backends - an array of AlgorithmSourceBackend.public Algorithm readAlgorithm(String id) throws AlgorithmSourceReadException
readAlgorithm in interface AlgorithmSourceid - an algorithm id String.Algorithm object, or null if no algorithm
with the specified id exists. If a null id is * specified, null is returned.AlgorithmSourceReadException - when an error occurs in a backend
reading the specified algorithm.public Set<Algorithm> readAlgorithms() throws AlgorithmSourceReadException
readAlgorithms in interface AlgorithmSourceSet of Algorithm
objects. Guaranteed not to return null.AlgorithmSourceReadException - when an error occurs in a backend
reading an algorithm.public void close()
throws SourceCloseException
AbstractSourceSource as a listener to the Backends
provided to the constructor.
Must be called by subclasses, or proper cleanup will not occur.close in interface AutoCloseableclose in interface Source<AlgorithmSourceUpdatedEvent,AlgorithmSourceBackend,AlgorithmSourceBackendUpdatedEvent>close in class AbstractSource<AlgorithmSourceUpdatedEvent,AlgorithmSourceBackend,AlgorithmSourceUpdatedEvent,AlgorithmSourceBackendUpdatedEvent>SourceCloseExceptionpublic void clear()
clear in interface Source<AlgorithmSourceUpdatedEvent,AlgorithmSourceBackend,AlgorithmSourceBackendUpdatedEvent>public void backendUpdated(AlgorithmSourceBackendUpdatedEvent event)
BackendListenerbackendUpdated in interface BackendListener<AlgorithmSourceBackendUpdatedEvent>event - an EventObjectCopyright © 2012–2018 Emory University. All rights reserved.