Package org.refcodes.configuration
Class ScheduledResourcePropertiesBuilderDecorator
- java.lang.Object
-
- org.refcodes.configuration.AbstractPropertiesDecorator<T>
-
- org.refcodes.configuration.AbstractPropertiesBuilderDecorator<T>
-
- org.refcodes.configuration.AbstractResourcePropertiesBuilderDecorator<ResourceProperties.ResourcePropertiesBuilder>
-
- org.refcodes.configuration.ScheduledResourcePropertiesBuilderDecorator
-
- All Implemented Interfaces:
java.io.Flushable
,java.util.Map<java.lang.String,java.lang.String>
,org.refcodes.component.Flushable
,org.refcodes.component.Flushable.FlushBuilder<ResourceProperties.ResourcePropertiesBuilder>
,org.refcodes.component.Startable
,org.refcodes.component.Stoppable
,Properties
,Properties.MutableProperties
,Properties.PropertiesBuilder
,ResourceProperties
,ResourceProperties.MutableResoureProperties
,ResourceProperties.ResourcePropertiesBuilder
,ScheduledResourceProperties
,ScheduledResourceProperties.ScheduledMuableResourceProperties
,ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
,org.refcodes.mixin.DelimiterAccessor
,org.refcodes.mixin.Disposable
,org.refcodes.mixin.Dumpable
,org.refcodes.mixin.TypeAccessor<java.lang.String>
,org.refcodes.structure.CanonicalMap
,org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
,org.refcodes.structure.CanonicalMap.MutableCanonicalMap
,org.refcodes.structure.Clearable
,org.refcodes.structure.Containable
,org.refcodes.structure.Dictionary<java.lang.String,java.lang.String>
,org.refcodes.structure.Dictionary.MutableDictionary<java.lang.String,java.lang.String>
,org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<java.lang.String,java.lang.String,org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>>
,org.refcodes.structure.Keys<java.lang.String,java.lang.String>
,org.refcodes.structure.Keys.MutableKeys<java.lang.String,java.lang.String>
,org.refcodes.structure.Keys.MutableValues<java.lang.String,java.lang.String>
,org.refcodes.structure.PathMap<java.lang.String>
,org.refcodes.structure.PathMap.MutablePathMap<java.lang.String>
,org.refcodes.structure.PathMap.PathMapBuilder<java.lang.String>
,org.refcodes.structure.PropertiesAccessorMixin
,org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<org.refcodes.structure.CanonicalMap.CanonicalMapBuilder>
,org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin
,org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
public class ScheduledResourcePropertiesBuilderDecorator extends AbstractResourcePropertiesBuilderDecorator<ResourceProperties.ResourcePropertiesBuilder> implements ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
TheScheduledResourcePropertiesBuilderDecorator
decoratesResourceProperties.ResourcePropertiesBuilder
from which the properties are to be reloaded periodically viaAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
. Depending on the invoked constructor, you can define whether orphan removal (seeAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
) is to be taken care of and the poll loop time, e.g. in which time interval the properties are to be reloaded.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.structure.CanonicalMap
org.refcodes.structure.CanonicalMap.CanonicalMapBuilder, org.refcodes.structure.CanonicalMap.MutableCanonicalMap
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.DelimiterAccessor
org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B extends org.refcodes.mixin.DelimiterAccessor.DelimiterBuilder<B>>, org.refcodes.mixin.DelimiterAccessor.DelimiterMutator, org.refcodes.mixin.DelimiterAccessor.DelimiterProperty
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary
org.refcodes.structure.Dictionary.MutableDictionary<K extends java.lang.Object,V extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.Dictionary.MutableDictionary
org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K extends java.lang.Object,V extends java.lang.Object,B extends org.refcodes.structure.Dictionary.MutableDictionary.DictionaryBuilder<K,V,B>>
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.Disposable
org.refcodes.mixin.Disposable.Disposedable
-
Nested classes/interfaces inherited from interface org.refcodes.component.Flushable
org.refcodes.component.Flushable.FlushBuilder<B extends org.refcodes.component.Flushable.FlushBuilder<B>>
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PathMap
org.refcodes.structure.PathMap.MutablePathMap<T extends java.lang.Object>, org.refcodes.structure.PathMap.PathMapBuilder<T extends java.lang.Object>
-
Nested classes/interfaces inherited from interface org.refcodes.configuration.Properties
Properties.MutableProperties, Properties.PropertiesBuilder
-
Nested classes/interfaces inherited from interface org.refcodes.structure.PropertiesAccessorMixin
org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin<T extends java.lang.Object>, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMixin, org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
-
Nested classes/interfaces inherited from interface org.refcodes.configuration.ResourceProperties
ResourceProperties.MutableResoureProperties, ResourceProperties.ResourcePropertiesBuilder
-
Nested classes/interfaces inherited from interface org.refcodes.configuration.ScheduledResourceProperties
ScheduledResourceProperties.ScheduledMuableResourceProperties, ScheduledResourceProperties.ScheduledResourcePropertiesBuilder
-
Nested classes/interfaces inherited from interface org.refcodes.component.Startable
org.refcodes.component.Startable.StartAutomaton, org.refcodes.component.Startable.StartBuilder<B extends org.refcodes.component.Startable.StartBuilder<B>>, org.refcodes.component.Startable.UncheckedStartable
-
-
Field Summary
-
Fields inherited from interface org.refcodes.configuration.ResourceProperties
VALUE_ATTRIBUTES
-
Fields inherited from interface org.refcodes.configuration.ResourceProperties.MutableResoureProperties
DEFAULT_COMMENT
-
-
Constructor Summary
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
void
start()
void
stop()
-
Methods inherited from class org.refcodes.configuration.AbstractPropertiesBuilderDecorator
clear, containsValue, entrySet, put, putAll, remove
-
Methods inherited from class org.refcodes.configuration.AbstractPropertiesDecorator
containsKey, get, getDelimiter, getProperties, isEmpty, keySet, setProperties, size, toDataStructure, values
-
Methods inherited from class org.refcodes.configuration.AbstractResourcePropertiesBuilderDecorator
childrenOf, flush, isFlushable, loadFrom, loadFrom, reload, reload, retrieveFrom, retrieveTo, saveTo, saveTo, seekFrom, toSerialized
-
Methods inherited from interface org.refcodes.structure.CanonicalMap
toInstance, toInstance, toType, toType
-
Methods inherited from interface org.refcodes.structure.CanonicalMap.CanonicalMapBuilder
withInsert, withInsert, withInsertFrom, withInsertTo
-
Methods inherited from interface org.refcodes.structure.CanonicalMap.MutableCanonicalMap
insert, insert, insertFrom, insertTo, putAll, toDump, toSourceCode, toSourceCode
-
Methods inherited from interface org.refcodes.component.Flushable.FlushBuilder
withFlush, withFlushUnchecked
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.refcodes.structure.PathMap
directories, directories, entries, entries, fromExternalKey, getArray, getArray, getRootPath, hasParentPath, isArray, isArray, isDirectory, isEntry, isRecord, isRootPath, keySet, paths, paths, records, records, toDataStructure, toDataStructure, toExternalKey, toMap, toNormalizedPath, toNormalizedPath, toParentPath, toPath
-
Methods inherited from interface org.refcodes.structure.PathMap.MutablePathMap
insert, insert, insert, insert, insertFrom, insertFrom, insertTo, insertTo, put, putArray, putArray, removeAll
-
Methods inherited from interface org.refcodes.structure.PathMap.PathMapBuilder
withInsert, withInsert, withInsertFrom, withInsertTo
-
Methods inherited from interface org.refcodes.configuration.Properties
getDelimiter, getType, toMap, toProperties, toPropertyPath
-
Methods inherited from interface org.refcodes.configuration.Properties.MutableProperties
containsValue, delete, delete, insert, insert, insertFrom, insertTo, put, putAll, putAll, putAll
-
Methods inherited from interface org.refcodes.configuration.Properties.PropertiesBuilder
childrenOf, retrieve, retrieveFrom, retrieveTo, withInsert, withInsert, withInsertFrom, withInsertTo
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin
containsKey, get, getBoolean, getBoolean, getByte, getByte, getCharacter, getCharacter, getDouble, getDouble, getFloat, getFloat, getInteger, getInteger, getLong, getLong, getShort, getShort, use, useBoolean, useBoolean, useByte, useByte, useDouble, useDouble, useFloat, useFloat, useInteger, useInteger, useLong, useLong, useShort, useShort
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesBuilderMixin
withPut
-
Methods inherited from interface org.refcodes.structure.PropertiesAccessorMixin.PropertiesMutatorMixin
put, put, putBoolean, putBoolean, putByte, putByte, putDouble, putDouble, putFloat, putFloat, putInteger, putInteger, putLong, putLong, putShort, putShort
-
Methods inherited from interface org.refcodes.configuration.ResourceProperties
reload, reload
-
Methods inherited from interface org.refcodes.configuration.ResourceProperties.MutableResoureProperties
fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, fileTo, flush, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, loadFrom, parseFrom, parseFrom, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, saveTo, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, seekFrom, toSerialized, toSerialized
-
Methods inherited from interface org.refcodes.configuration.ResourceProperties.ResourcePropertiesBuilder
withInsert, withInsert, withInsertFrom, withInsertTo, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withLoadFrom, withPut, withPut, withPutBoolean, withPutByte, withPutDouble, withPutFloat, withPutInteger, withPutLong, withPutShort, withRemoveFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom, withSeekFrom
-
-
-
-
Constructor Detail
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
and orphan removal (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called withtrue
). The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and orphan removal (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called withtrue
). The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
and the given orphan removal strategy (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called with your argument). The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and the given orphan removal strategy (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called with your argument). The schedulingThread
is started as daemon thread (seeThreadMode.DAEMON
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with default settings being a poll loop time of 10 seconds (as ofPollLoopTime.NORM
and orphan removal (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called withtrue
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and orphan removal (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called withtrue
). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the the default poll loop time of 10 seconds (as ofPollLoopTime.NORM
and the given orphan removal strategy (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
ScheduledResourcePropertiesBuilderDecorator
public ScheduledResourcePropertiesBuilderDecorator(ResourceProperties.ResourcePropertiesBuilder aProperties, int aScheduleTimeInMillis, ReloadMode aReloadMode, org.refcodes.controlflow.ThreadMode aThreadMode) throws java.io.IOException, java.text.ParseException, java.lang.IllegalStateException
Constructs theScheduledResourcePropertiesBuilderDecorator
wrapping the givenResourceProperties.ResourcePropertiesBuilder
with setting the given poll loop time and the given orphan removal strategy (as ofAbstractResourcePropertiesBuilderDecorator.reload(ReloadMode)
being called with your argument). Immediately starts polling after construction of this instance for new properties.- Parameters:
aProperties
- The properties from which the properties are to be reloaded periodically.aScheduleTimeInMillis
- The time in milliseconds between polling for new properties.aReloadMode
- when set toReloadMode.ORPHAN_REMOVAL
, then properties existing in the attached resource but not(!) in theProperties
itself are(!) removed. Else properties not existing in the attached resource are kept.aThreadMode
- TheThreadMode
mode of operation regarding theThread
doing the scheduling job.- Throws:
java.io.IOException
- thrown in case accessing the resource encountered an I/O problem.java.lang.IllegalStateException
- in case the attached resource does not support reloading.java.text.ParseException
- Signals that an error has been reached unexpectedly while parsing the data to be loaded.
-
-
Method Detail
-
start
public void start() throws org.refcodes.component.StartException
- Specified by:
start
in interfaceorg.refcodes.component.Startable
- Throws:
org.refcodes.component.StartException
-
stop
public void stop() throws org.refcodes.component.StopException
- Specified by:
stop
in interfaceorg.refcodes.component.Stoppable
- Throws:
org.refcodes.component.StopException
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.refcodes.mixin.Disposable
-
-