Package org.opennms.core.config.api
Interface ReloadingContainer<T>
-
- Type Parameters:
T
- bean type
- All Known Implementing Classes:
ConfigReloadContainer
public interface ReloadingContainer<T>
A container managing a bean which can reloaded.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Long
getLastUpdate()
Retrieve the time at which the object was last updated.T
getObject()
Retrieve the object held by the container.void
reload()
Immediately reload the object.void
setReloadCheckInterval(Long reloadCheckInterval)
Set the frequency at which the object should be checked for updates.
-
-
-
Method Detail
-
getObject
T getObject()
Retrieve the object held by the container. May also trigger a reload if the check interval has passed.- Returns:
- the object
-
reload
void reload()
Immediately reload the object. The next call togetObject()
will return the updated object.
-
setReloadCheckInterval
void setReloadCheckInterval(Long reloadCheckInterval)
Set the frequency at which the object should be checked for updates. The check is performed when calls togetObject()
are made once the interval has passed.- Parameters:
reloadCheckInterval
- interval in ms, ifnull
the default value will be used, if <= 0 reload checks will be disabled
-
getLastUpdate
Long getLastUpdate()
Retrieve the time at which the object was last updated.- Returns:
- timestamp in ms
-
-