public abstract class RegularListener<L extends RegularListener<L>> extends AbstractListener implements ScopedConfigurable
AbstractListener.InternalProbe<T>, AbstractListener.RegistrationHook
Modifier and Type | Field and Description |
---|---|
protected RegularListener.DataInjector<? super L> |
dataInjector
Underlying event data injector for injecting
additional data to event objects before validation.
|
protected DisplayExecutor |
displayExecutor
Underlying display executor for executing tasks requiring UI threads.
|
protected RegularListener.EventValidator<? super L> |
eventValidator
Underlying event data validator for validating
event objects before persistence.
|
protected RegularListener.OptionsLoader<? super L> |
optionsLoader
Underlying listener options holder.
|
protected RegularListener.PersistenceStore<? super L> |
persistenceStore
Underlying persistence store for persisting event data.
|
protected PluginConsole |
pluginConsole
Underlying plug-in console for general logging.
|
protected RegularListener.SendFailureHandler<? super L> |
sendFailureHandler
Underlying event data send failure handler.
|
protected java.util.concurrent.ExecutorService |
sharedExecutor
Underlying executor service for executing common commands.
|
protected RegularListener.TimeContext |
timeContext
Underlying time context.
|
Modifier | Constructor and Description |
---|---|
protected |
RegularListener(RegularListener.Configuration<C,L> configuration)
Constructor for use by subclasses.
|
protected |
RegularListener(RegularListener.Configuration<C,L> configuration,
C context)
Constructor for use by subclasses.
|
Modifier and Type | Method and Description |
---|---|
protected com.google.common.base.Stopwatch |
createStopwatch() |
protected long |
currentTime() |
protected Options |
customOptions()
Returns an updating view of custom options.
|
protected Options |
defaultOptions()
Returns an updating view of default options.
|
protected Options |
effectiveOptions()
Returns an updating view of effective options.
|
protected com.google.common.base.Ticker |
elapsedTimeTicker() |
protected <V> V |
execute(DisplayTask<V> task) |
protected void |
execute(java.lang.Runnable command) |
Options |
getOptions()
Gets effective options of this configurable instance.
|
Options |
getOptions(Scope scope)
Gets scoped options of this configurable instance.
|
protected Options |
getOptionsForNonStandardScope(Scope scope) |
RegularListener.TimeContext |
getTimeContext() |
protected void |
inject(java.lang.String path,
Event data) |
protected java.util.Map<java.lang.String,AbstractListener.InternalProbe<?>> |
internalProbeMappings() |
protected void |
onFinalUnregistration()
Invoked automatically on final unregistration when workbench is closing.
|
protected void |
onOptionsReload()
Invoked always after
RegularListener.OptionsLoader loads any options. |
protected void |
onWorkbenchShutdown()
Invoked automatically on workbench shutdown.
|
protected void |
persist(java.lang.String path,
Event data) |
protected void |
postRegisterFailure(java.lang.Runnable task,
java.lang.Exception failure) |
protected void |
postUnregisterFailure(java.lang.Runnable task,
java.lang.Exception failure) |
protected void |
preRegisterFailure(java.lang.Runnable task,
java.lang.Exception failure) |
protected void |
preUnregisterFailure(java.lang.Runnable task,
java.lang.Exception failure) |
protected void |
reloadOptions()
An
OptionsLoader invokes this method to reload effective options. |
protected void |
sendFailure(java.lang.String path,
Event data,
java.lang.Exception failure) |
protected void |
validate(java.lang.String path,
Event data) |
protected TimeSource |
wallTimeSource() |
clone, equals, finalize, hashCode, postRegister, postUnregister, preRegister, preUnregister, send, send, send, toString
protected final RegularListener.OptionsLoader<? super L extends RegularListener<L>> optionsLoader
protected final RegularListener.TimeContext timeContext
protected final PluginConsole pluginConsole
protected final DisplayExecutor displayExecutor
protected final java.util.concurrent.ExecutorService sharedExecutor
protected final RegularListener.DataInjector<? super L extends RegularListener<L>> dataInjector
protected final RegularListener.EventValidator<? super L extends RegularListener<L>> eventValidator
protected final RegularListener.PersistenceStore<? super L extends RegularListener<L>> persistenceStore
protected final RegularListener.SendFailureHandler<? super L extends RegularListener<L>> sendFailureHandler
protected RegularListener(RegularListener.Configuration<C,L> configuration)
protected RegularListener(RegularListener.Configuration<C,L> configuration, C context)
protected final Options defaultOptions()
RegularListener.OptionsLoader
.
Note: always returns the same instance.
protected final Options customOptions()
RegularListener.OptionsLoader
.
Note: always returns the same instance.
reloadOptions()
protected final Options effectiveOptions()
RegularListener.OptionsLoader
.
Note: always returns the same instance.
reloadOptions()
protected final void reloadOptions()
OptionsLoader
invokes this method to reload effective options.
Always invokes onOptionsReload()
after reloading options.onOptionsReload()
protected void onOptionsReload()
RegularListener.OptionsLoader
loads any options.reloadOptions()
protected final long currentTime()
protected final TimeSource wallTimeSource()
protected final com.google.common.base.Stopwatch createStopwatch()
protected final com.google.common.base.Ticker elapsedTimeTicker()
protected final <V> V execute(DisplayTask<V> task)
execute
in class AbstractListener
protected final void execute(java.lang.Runnable command)
execute
in class AbstractListener
protected final void preRegisterFailure(java.lang.Runnable task, java.lang.Exception failure)
preRegisterFailure
in class AbstractListener
protected final void postRegisterFailure(java.lang.Runnable task, java.lang.Exception failure)
postRegisterFailure
in class AbstractListener
protected final void preUnregisterFailure(java.lang.Runnable task, java.lang.Exception failure)
preUnregisterFailure
in class AbstractListener
protected final void postUnregisterFailure(java.lang.Runnable task, java.lang.Exception failure)
postUnregisterFailure
in class AbstractListener
protected final void inject(java.lang.String path, Event data)
inject
in class AbstractListener
protected final void validate(java.lang.String path, Event data)
validate
in class AbstractListener
protected final void persist(java.lang.String path, Event data) throws java.lang.Exception
persist
in class AbstractListener
java.lang.Exception
protected final void sendFailure(java.lang.String path, Event data, java.lang.Exception failure)
sendFailure
in class AbstractListener
protected java.util.Map<java.lang.String,AbstractListener.InternalProbe<?>> internalProbeMappings()
internalProbeMappings
in class AbstractListener
protected final void onWorkbenchShutdown() throws java.lang.Exception
Warning: users should not invoke this method directly.
Current implementation does nothing.
onWorkbenchShutdown
in class AbstractListener
java.lang.Exception
protected final void onFinalUnregistration() throws java.lang.Exception
Warning: users should not invoke this method directly.
Current implementation invokes configured RegularListener.DisposalHook
.
onFinalUnregistration
in class AbstractListener
java.lang.Exception
public final Options getOptions()
Note: always returns the same instance.
getOptions
in interface Configurable
public final Options getOptions(Scope scope)
Note: always returns the same instance.
getOptions
in interface ScopedConfigurable
scope
- the scope to be applied, not null
java.lang.IllegalArgumentException
- if an unknown scope is specifiedjava.lang.NullPointerException
- if the scope
is null
public final RegularListener.TimeContext getTimeContext()