Sonic ESB API

com.sonicsw.esb.service.common.util.variables
Class PropertiesURLVariableResolver

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

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
 


Nested Class Summary
 class PropertiesURLVariableResolver.PropertyFileVariable
          Variable implementation for properties URL variables.
 
Nested classes/interfaces inherited from interface com.sonicsw.esb.service.common.util.variables.VariableFactory
VariableFactory.Variable
 
Field Summary
static java.lang.String DYNAMIC
           
static java.lang.String SCHEME
           
 
Constructor Summary
PropertiesURLVariableResolver()
           
 
Method Summary
 VariableFactory.Variable createVariable(java.lang.String url, java.lang.String propertyName)
           
 VariableFactory.Variable createVariable(java.lang.String url, java.lang.String propertyName, boolean dynamic)
           
 java.lang.String getScheme()
           
 VariableFactory.Variable getVariable(java.lang.String variableStr)
          Returns a Variable for the given variable string.
 void handleFileChange(java.lang.String path)
           
 java.lang.String resolve(java.lang.String variableStr)
          Attempts to resolve the given variable.
 void setFileChangeManager(FileChangeManager fileChangeManager)
           
 void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

PropertiesURLVariableResolver

public PropertiesURLVariableResolver()
Method Detail

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

Sonic ESB API

Copyright © 2001-2013 Aurea, Inc. All Rights Reserved.
HTML formatted on 29-April-2013.