com.sonicsw.esb.service.common.util.variables
Class PropertiesURLVariableResolver
java.lang.Object
com.sonicsw.esb.service.common.util.variables.PropertiesURLVariableResolver
- All Implemented Interfaces:
- FileChangeManager.FileChangeHandler, VariableFactory, VariableResolver, org.springframework.context.ResourceLoaderAware
public class PropertiesURLVariableResolver
- extends java.lang.Object
- implements VariableResolver, VariableFactory, org.springframework.context.ResourceLoaderAware, FileChangeManager.FileChangeHandler
VariableResolver
implementation for variables that specify a
property in a properties file. Properties URL variables are of the form:
property:fileURL#propertyName
The fileURL may be any valid URL or a classpath:
location.
Some examples:
- property:sonicfs:///workspace/MyProject/test.properties#name
- property:file://C/temp/test.properties#name
- property:classpath:com/sonicsw/esb/service/common/test.properties#name
Properties files are cached by default. To force the current value from the
properties file to be used each time the variable is resolved, use the form:
property:dynamic:fileURL#propertyName
Field Summary |
static java.lang.String |
DYNAMIC
|
static java.lang.String |
SCHEME
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SCHEME
public static final java.lang.String SCHEME
- See Also:
- Constant Field Values
DYNAMIC
public static final java.lang.String DYNAMIC
- See Also:
- Constant Field Values
PropertiesURLVariableResolver
public PropertiesURLVariableResolver()
getScheme
public java.lang.String getScheme()
getVariable
public VariableFactory.Variable getVariable(java.lang.String variableStr)
- Description copied from interface:
VariableFactory
- Returns a
Variable
for the given variable string.
- Specified by:
getVariable
in interface VariableFactory
createVariable
public VariableFactory.Variable createVariable(java.lang.String url,
java.lang.String propertyName)
createVariable
public VariableFactory.Variable createVariable(java.lang.String url,
java.lang.String propertyName,
boolean dynamic)
resolve
public java.lang.String resolve(java.lang.String variableStr)
- Description copied from interface:
VariableResolver
- Attempts to resolve the given variable. May return null.
- Specified by:
resolve
in interface VariableResolver
handleFileChange
public void handleFileChange(java.lang.String path)
- Specified by:
handleFileChange
in interface FileChangeManager.FileChangeHandler
setFileChangeManager
public void setFileChangeManager(FileChangeManager fileChangeManager)
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoader
in interface org.springframework.context.ResourceLoaderAware
Copyright © 2001-2013 Aurea, Inc. All Rights Reserved.
HTML formatted on 29-April-2013.