org.springframework.integration.context.metadata
Class PropertiesBasedMetadataPersister
java.lang.Object
org.springframework.integration.context.metadata.PropertiesBasedMetadataPersister
- All Implemented Interfaces:
- InitializingBean, MetadataPersister<String>
public class PropertiesBasedMetadataPersister
- extends Object
- implements MetadataPersister<String>, InitializingBean
Implementation of MetadataPersister
that knows how to write metadata
to a Properties
instance.
TODO could this perhaps participate or at least be aware of our transaction synchronization mechanism? IE: no guarantees, but we at least try to write on commit()s?
- Author:
- Josh Long
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PropertiesBasedMetadataPersister
public PropertiesBasedMetadataPersister(Resource ultimateResourceToWhichToWriteFile)
PropertiesBasedMetadataPersister
public PropertiesBasedMetadataPersister(String uniqueName)
PropertiesBasedMetadataPersister
public PropertiesBasedMetadataPersister()
setExecutor
public void setExecutor(Executor executor)
setLocationOfPropertiesOnDisk
public void setLocationOfPropertiesOnDisk(Resource locationOfPropertiesOnDisk)
setProperties
public void setProperties(Properties properties)
- Optional - if there's already a
Properties
instance in play than we can simply use that one.
- Parameters:
properties
- existing properties, just in case
write
public void write(String key,
String value)
- Specified by:
write
in interface MetadataPersister<String>
setUniqueName
public void setUniqueName(String uniqueName)
- This is required to ensure contiuity across restarts. It must be meaningful to a given application of a given component.
- Parameters:
uniqueName
- the unqiue name to use in constructing a Resource
for the Properties
file
read
public String read(String key)
- Specified by:
read
in interface MetadataPersister<String>
setSupportAsyncWrites
public void setSupportAsyncWrites(boolean supportAsyncWrites)
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
setLocations
public void setLocations(Resource[] locations)
setLocation
public void setLocation(Resource location)
Copyright © 2010. All Rights Reserved.