Class AbstractLocationPropertiesSource
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.properties.AbstractLocationPropertiesSource
- All Implemented Interfaces:
AutoCloseable
,LocationPropertiesSource
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.LoadablePropertiesSource
,org.apache.camel.spi.PropertiesSource
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
ClasspathPropertiesSource
,FilePropertiesSource
public abstract class AbstractLocationPropertiesSource
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.LoadablePropertiesSource, LocationPropertiesSource
Base class for
LoadablePropertiesSource
which can load properties from a source such as classpath or file
system.-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractLocationPropertiesSource
(PropertiesComponent propertiesComponent, PropertiesLocation location) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doInit()
protected void
Gets the location of the propertiesgetProperty
(String name) loadProperties
(Predicate<String> filter) abstract Properties
loadPropertiesFromLocation
(PropertiesComponent propertiesComponent, PropertiesLocation location) protected static Properties
prepareLoadedProperties
(Properties properties) Strategy to prepare loaded properties before being used by Camel.void
reloadProperties
(String location) void
setProperty
(String key, String value) Sets a propertyMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.spi.PropertiesSource
getName
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
AbstractLocationPropertiesSource
protected AbstractLocationPropertiesSource(PropertiesComponent propertiesComponent, PropertiesLocation location)
-
-
Method Details
-
loadPropertiesFromLocation
public abstract Properties loadPropertiesFromLocation(PropertiesComponent propertiesComponent, PropertiesLocation location) -
getLocation
Description copied from interface:LocationPropertiesSource
Gets the location of the properties- Specified by:
getLocation
in interfaceLocationPropertiesSource
-
loadProperties
- Specified by:
loadProperties
in interfaceorg.apache.camel.spi.LoadablePropertiesSource
-
loadProperties
- Specified by:
loadProperties
in interfaceorg.apache.camel.spi.LoadablePropertiesSource
-
reloadProperties
- Specified by:
reloadProperties
in interfaceorg.apache.camel.spi.LoadablePropertiesSource
-
getProperty
- Specified by:
getProperty
in interfaceorg.apache.camel.spi.PropertiesSource
-
setProperty
Sets a property- Parameters:
key
- the keyvalue
- the value
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doShutdown
- Overrides:
doShutdown
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
prepareLoadedProperties
Strategy to prepare loaded properties before being used by Camel. This implementation will ensure values are trimmed, as loading properties from a file with values having trailing spaces is not automatically trimmed by the Properties API from the JDK.- Parameters:
properties
- the properties- Returns:
- the prepared properties
-