public abstract class ContextBuilderConfigurator extends PollingScheduler<ContextBuilderConfigurator>
A configurator configures ContextBuilder
. It's is called by a WUIC bootstrap in charge of Context
creation using a ContextBuilder
.
This class is abstract and should be extended to configure in a specific way the ContextBuilder
.
PollingScheduler.Polling
Modifier | Constructor and Description |
---|---|
protected |
ContextBuilderConfigurator()
Builds a new instance.
|
protected |
ContextBuilderConfigurator(Boolean multiple)
Builds a configurator with a flag indicating to configure or not anything if a configuration with its tag has
been done before.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(ContextBuilder ctxBuilder)
Configures the given context.
|
abstract ProcessContext |
getProcessContext()
Gets the process context associated to the tag while configuring.
|
abstract String |
getTag()
Gets the tag to use to identify the set of settings defined when
configure(ContextBuilder)
is called. |
abstract int |
internalConfigure(ContextBuilder ctxBuilder)
Configures the given context internally.
|
void |
run() |
void |
setMultipleConfigurations(Boolean flag)
Sets the flag allowing or not multiple configurations.
|
getLastUpdateTimestampFor, getNutObservers, getPollingInterval, observe, setPollingInterval
protected ContextBuilderConfigurator()
Builds a new instance.
protected ContextBuilderConfigurator(Boolean multiple)
Builds a configurator with a flag indicating to configure or not anything if a configuration with its tag has been done before.
multiple
- true
if multiple configurations with the same tag could be executed, false
otherwisepublic void setMultipleConfigurations(Boolean flag)
Sets the flag allowing or not multiple configurations.
flag
- the new valuepublic void run()
public void configure(ContextBuilder ctxBuilder) throws IOException
Configures the given context. It tags all the settings with the value returned by
the getTag()
method.
All settings associated to each configurator tag are cleared before (re)configuration.
ctxBuilder
- the builderIOException
- if I/O error occurs when start pollingpublic abstract int internalConfigure(ContextBuilder ctxBuilder)
Configures the given context internally. This method is called just after the ContextBuilder
has been
tagged with the value returned by getTag()
method. Once the
execution of this method is terminated, the tag is released.
To activate polling on this configurator, this method should returns a positive integer representing the polling interval in seconds.
ctxBuilder
- the builderpublic abstract String getTag()
Gets the tag to use to identify the set of settings defined when configure(ContextBuilder)
is called.
public abstract ProcessContext getProcessContext()
Gets the process context associated to the tag while configuring.
Copyright © 2012-2015. All Rights Reserved.