@NotThreadSafe public abstract static class ForwarderModule.Abstract extends Object implements ForwarderModule
Modifier and Type | Class and Description |
---|---|
protected static class |
ForwarderModule.Abstract.AbstractInputOutput
Abstract input/output.
|
protected static interface |
ForwarderModule.Abstract.ModuleInputOutput
Module input/output.
|
ForwarderModule.Abstract
Modifier and Type | Field and Description |
---|---|
static String |
BATCH_LIMIT_PROPERTY
Specifies the maximum number of messages in a transaction.
|
static String |
CONNECTION_RETRY_DELAY_PROPERTY
The time in millis before trying to reconnect to the service.
|
static ElapsedTime |
DEFAULT_CONNECTION_RETRY_DELAY
Default connection retry delay.
|
static String |
FILTER_CLASS_PROPERTY
The filter class property.
|
static String |
FILTER_PROPERTIES
The filter properties group.
|
static String |
MODULE_UUID_PROPERTY
A UUID for the module.
|
static String |
PASSWORD_PROPERTY
Password property.
|
static String |
RELIABLE_PROPERTY
Reliable property.
|
static String |
TRACES_PROPERTY
The names of the subdirectory holding traces for this module.
|
static String |
USER_PROPERTY
User property.
|
Constructor and Description |
---|
Abstract() |
Modifier and Type | Method and Description |
---|---|
protected Serializable[] |
filter(Serializable[] messages)
Filters messages.
|
BatchControl |
getBatchControl()
Gets the batch control.
|
Config |
getConfig()
Gets the configuration.
|
KeyedGroups |
getConfigProperties()
Gets the configuration properties.
|
protected ElapsedTime |
getConnectionRetryDelay()
Gets the service connection retry delay.
|
protected abstract int |
getDefaultBatchLimit()
Gets the default batch limit.
|
protected Optional<ElapsedTime> |
getDefaultBatchWait()
Gets the default batch wait.
|
protected ForwarderServiceAppImpl |
getForwarderAppImpl()
Gets the owner of this module.
|
protected Metadata |
getMetadata()
Gets the metadata.
|
protected Optional<Boolean> |
getReliable()
Gets the reliable indicator.
|
Service |
getService()
Gets the owner of this module.
|
Logger |
getThisLogger()
Gets the logger.
|
Traces |
getTraces()
Gets the traces.
|
boolean |
isReliable()
Asks if the module is reliable.
|
protected boolean |
loadMetadata(MetadataFilter metadataFilter)
Loads the metadata.
|
boolean |
needsMetadata()
Asks if this module needs metadata.
|
boolean |
onMetadataRefreshed()
Called when the metadata should be refreshed.
|
protected void |
setReliable(Boolean reliable)
Sets the reliable indicator.
|
boolean |
setUp(ForwarderServiceAppImpl forwarderApp,
KeyedGroups moduleProperties)
Sets up this module.
|
protected abstract boolean |
setUp(KeyedGroups moduleProperties)
Sets up this module.
|
void |
tearDown()
Tears down what has been set up.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
start, stop
public static final String BATCH_LIMIT_PROPERTY
public static final String CONNECTION_RETRY_DELAY_PROPERTY
public static final ElapsedTime DEFAULT_CONNECTION_RETRY_DELAY
public static final String FILTER_CLASS_PROPERTY
public static final String FILTER_PROPERTIES
public static final String MODULE_UUID_PROPERTY
public static final String PASSWORD_PROPERTY
public static final String RELIABLE_PROPERTY
public static final String TRACES_PROPERTY
public static final String USER_PROPERTY
public final BatchControl getBatchControl()
getBatchControl
in interface ForwarderModule
public final Config getConfig()
getConfig
in interface ForwarderModule
@Nonnull @CheckReturnValue public final KeyedGroups getConfigProperties()
public final Service getService()
getService
in interface ForwarderModule
@Nonnull @CheckReturnValue public final Logger getThisLogger()
@Nonnull @CheckReturnValue public final Traces getTraces()
public boolean isReliable()
isReliable
in interface ForwarderModule
public boolean needsMetadata()
needsMetadata
in interface ForwarderModule
public boolean onMetadataRefreshed()
onMetadataRefreshed
in interface ForwarderModule
public final boolean setUp(ForwarderServiceAppImpl forwarderApp, KeyedGroups moduleProperties)
setUp
in interface ForwarderModule
forwarderApp
- The owner of this module.moduleProperties
- The module properties.public void tearDown()
tearDown
in interface ForwarderModule
@Nonnull @CheckReturnValue protected final Serializable[] filter(@Nonnull Serializable[] messages) throws InterruptedException, ServiceNotAvailableException
messages
- The messages to be filtered.InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not
available.@Nonnull @CheckReturnValue protected final ElapsedTime getConnectionRetryDelay()
@CheckReturnValue protected abstract int getDefaultBatchLimit()
@Nonnull @CheckReturnValue protected Optional<ElapsedTime> getDefaultBatchWait()
@Nonnull @CheckReturnValue protected final ForwarderServiceAppImpl getForwarderAppImpl()
@Nonnull @CheckReturnValue protected final Metadata getMetadata()
@Nonnull @CheckReturnValue protected Optional<Boolean> getReliable()
@CheckReturnValue protected final boolean loadMetadata(@Nonnull MetadataFilter metadataFilter)
metadataFilter
- The metadata filter.protected void setReliable(@Nonnull Boolean reliable)
reliable
- The reliable indicator.@CheckReturnValue protected abstract boolean setUp(@Nonnull KeyedGroups moduleProperties)
moduleProperties
- The module properties.Copyright © 2003-2019 Serge Brisson. All Rights Reserved.