public abstract static class UpdatesListener.Abstract extends Object implements UpdatesListener, ServiceThread.Target
UpdatesListener.Abstract
Modifier and Type | Field and Description |
---|---|
static String |
BATCH_LIMIT_PROPERTY
Specifies to batch the updates by this number.
|
static int |
DEFAULT_BATCH_LIMIT
Default batch limit.
|
Constructor and Description |
---|
Abstract() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doCommit()
Registers that the updates have been processed.
|
protected void |
doStart()
Does start.
|
protected abstract void |
doStop()
Stops in preparation to tear down.
|
protected StoreServer |
getServer()
Gets the store server.
|
protected StoreStats |
getStats()
Gets the stats.
|
protected Logger |
getThisLogger()
Gets the logger.
|
protected abstract Optional<PointValue> |
nextUpdate(int limit,
boolean wait)
Returns the next update.
|
void |
onMetadataRefreshed(Metadata metadata)
Called when the metadata has been refreshed.
|
void |
run()
Runs.
|
void |
setServer(StoreServer server)
Sets the store server.
|
boolean |
setUp(StoreServiceAppImpl storeAppImpl,
KeyedGroups listenerProperties)
Sets up for processing.
|
void |
start()
Starts this.
|
void |
stop()
Stops this.
|
void |
tearDown()
Tears down what has been set up.
|
public static final String BATCH_LIMIT_PROPERTY
public static final int DEFAULT_BATCH_LIMIT
public void onMetadataRefreshed(Metadata metadata)
onMetadataRefreshed
in interface UpdatesListener
metadata
- The new metadata.public final void run() throws ServiceNotAvailableException, InterruptedException
Similar to same in Runnable but may throw exceptions.
run
in interface ServiceThread.Target
ServiceNotAvailableException
InterruptedException
public final void setServer(StoreServer server)
setServer
in interface UpdatesListener
server
- The store server.public boolean setUp(StoreServiceAppImpl storeAppImpl, KeyedGroups listenerProperties)
setUp
in interface UpdatesListener
storeAppImpl
- The store application implementation.listenerProperties
- The listener properties.public final void start()
start
in interface UpdatesListener
public final void stop()
stop
in interface UpdatesListener
public void tearDown()
tearDown
in interface UpdatesListener
protected abstract void doCommit() throws InterruptedException
Called while synchronized on this.
InterruptedException
- When the Service is stopped.protected void doStart() throws InterruptedException
InterruptedException
- When the service is stopped.protected abstract void doStop()
Called while synchronized on this.
@Nonnull @CheckReturnValue protected final StoreServer getServer()
@Nonnull @CheckReturnValue protected final StoreStats getStats()
@Nonnull @CheckReturnValue protected final Logger getThisLogger()
@Nonnull @CheckReturnValue protected abstract Optional<PointValue> nextUpdate(int limit, boolean wait) throws InterruptedException
limit
- The read ahead limit.wait
- True to wait.InterruptedException
- When the Service is stopped.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.