Spring Integration

org.springframework.integration.context.metadata
Class PropertiesBasedMetadataPersister

java.lang.Object
  extended by 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

Constructor Summary
PropertiesBasedMetadataPersister()
           
PropertiesBasedMetadataPersister(Resource ultimateResourceToWhichToWriteFile)
           
PropertiesBasedMetadataPersister(String uniqueName)
           
 
Method Summary
 void afterPropertiesSet()
           
 String read(String key)
           
 void setExecutor(Executor executor)
           
 void setLocation(Resource location)
           
 void setLocationOfPropertiesOnDisk(Resource locationOfPropertiesOnDisk)
           
 void setLocations(Resource[] locations)
           
 void setProperties(Properties properties)
          Optional - if there's already a Properties instance in play than we can simply use that one.
 void setSupportAsyncWrites(boolean supportAsyncWrites)
           
 void setUniqueName(String uniqueName)
          This is required to ensure contiuity across restarts.
 void write(String key, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesBasedMetadataPersister

public PropertiesBasedMetadataPersister(Resource ultimateResourceToWhichToWriteFile)

PropertiesBasedMetadataPersister

public PropertiesBasedMetadataPersister(String uniqueName)

PropertiesBasedMetadataPersister

public PropertiesBasedMetadataPersister()
Method Detail

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)

Spring Integration

Copyright © 2010. All Rights Reserved.