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, toStringprotected 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 AbstractListenerprotected final void execute(java.lang.Runnable command)
execute in class AbstractListenerprotected final void preRegisterFailure(java.lang.Runnable task,
java.lang.Exception failure)
preRegisterFailure in class AbstractListenerprotected final void postRegisterFailure(java.lang.Runnable task,
java.lang.Exception failure)
postRegisterFailure in class AbstractListenerprotected final void preUnregisterFailure(java.lang.Runnable task,
java.lang.Exception failure)
preUnregisterFailure in class AbstractListenerprotected final void postUnregisterFailure(java.lang.Runnable task,
java.lang.Exception failure)
postUnregisterFailure in class AbstractListenerprotected final void inject(java.lang.String path,
Event data)
inject in class AbstractListenerprotected final void validate(java.lang.String path,
Event data)
validate in class AbstractListenerprotected final void persist(java.lang.String path,
Event data)
throws java.lang.Exception
persist in class AbstractListenerjava.lang.Exceptionprotected final void sendFailure(java.lang.String path,
Event data,
java.lang.Exception failure)
sendFailure in class AbstractListenerprotected java.util.Map<java.lang.String,AbstractListener.InternalProbe<?>> internalProbeMappings()
internalProbeMappings in class AbstractListenerprotected final void onWorkbenchShutdown()
throws java.lang.Exception
Warning: users should not invoke this method directly.
Current implementation does nothing.
onWorkbenchShutdown in class AbstractListenerjava.lang.Exceptionprotected final void onFinalUnregistration()
throws java.lang.Exception
Warning: users should not invoke this method directly.
Current implementation invokes configured RegularListener.DisposalHook.
onFinalUnregistration in class AbstractListenerjava.lang.Exceptionpublic final Options getOptions()
Note: always returns the same instance.
getOptions in interface Configurablepublic final Options getOptions(Scope scope)
Note: always returns the same instance.
getOptions in interface ScopedConfigurablescope - the scope to be applied, not nulljava.lang.IllegalArgumentException - if an unknown scope is specifiedjava.lang.NullPointerException - if the scope is nullpublic final RegularListener.TimeContext getTimeContext()