*/
public abstract class AbstractDatasource implements Datasource {
- protected ListenerList<DatasourceListener> listeners = new ListenerList<DatasourceListener>(DatasourceListener.class);
+ protected ListenerList<DatasourceListener> listeners = new ListenerList<>(DatasourceListener.class);
protected Lock readLock, writeLock;
public AbstractDatasource() {
listeners.remove(listener);
}
- protected void notifyStep() {
- for (final DatasourceListener l : listeners.getListeners()) {
+ protected void notifyStep(Datasource source) {
+ for (DatasourceListener l : listeners.getListeners()) {
if (l.getExecutor() == null) {
- l.onStep( AbstractDatasource.this );
+ l.onStep( source );
} else {
- l.getExecutor().execute(new Runnable() {
- public void run() {
- l.onStep(AbstractDatasource.this);
- }
- });
+ l.getExecutor().execute(() -> l.onStep(source));
}
}
}
+ protected void notifyStep() {
+ notifyStep(AbstractDatasource.this);
+ }
+
@Override
public Lock readLock() {
return readLock;