Interface VariableRegistry
public interface VariableRegistry
A Service for resolving variables to their values. Variables may be predefined by the
 runtime, or be read from bootstrap.properties or the server.xml configuration.
 
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe variable literal for obtaining the server install location.static final StringThe variable literal for obtaining the server configuration directory.static final StringThe variable literal for obtaining the server name.static final StringThe variable literal for obtaining the server output directory.static final StringThe variable literal for obtaining the shared applications directory.static final StringThe variable literal for obtaining the shared configuration directory.static final StringThe variable literal for obtaining the shared resources directory.static final StringThe variable literal for obtaining the server user directory.static final StringThe variable literal for obtaining the usr product extension directory.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddVariable(String variable, String value) Add a variable to the registry with the specified value if it does not exist already.voidremoveVariable(String variable) Remove the specified variable from the registry.voidreplaceVariable(String variable, String value) Update the variable in the registry with the specified value.resolveRawString(String string) Resolve the variables in the given string.resolveString(String string) Resolve the variables in the given string.
- 
Field Details- 
SERVER_NAMEThe variable literal for obtaining the server name.- See Also:
 
- 
INSTALL_DIRThe variable literal for obtaining the server install location.- See Also:
 
- 
USER_DIRThe variable literal for obtaining the server user directory.- See Also:
 
- 
USER_EXTENSION_DIRThe variable literal for obtaining the usr product extension directory.- See Also:
 
- 
SERVER_CONFIG_DIRThe variable literal for obtaining the server configuration directory.- See Also:
 
- 
SERVER_OUTPUT_DIRThe variable literal for obtaining the server output directory.- See Also:
 
- 
SHARED_APPS_DIRThe variable literal for obtaining the shared applications directory.- See Also:
 
- 
SHARED_CONFIG_DIRThe variable literal for obtaining the shared configuration directory.- See Also:
 
- 
SHARED_RESC_DIRThe variable literal for obtaining the shared resources directory.- See Also:
 
 
- 
- 
Method Details- 
addVariableAdd a variable to the registry with the specified value if it does not exist already.- Parameters:
- variable- the name of the variable.
- value- the value of the variable.
- Returns:
- true if it was added, false otherwise.
 
- 
replaceVariableUpdate the variable in the registry with the specified value. If it does not exist already this will add the variable, if it already exists it will be overwritten.- Parameters:
- variable- the name of the variable.
- value- the value of the variable.
 
- 
resolveStringResolve the variables in the given string. This can be used either to resolve a string that contains variables in it, such as The server is called ${wlp.server.name}. or to specifically discover the value of a variable by wrapping it in ${ and } for example ${wlp.server.name}. If the variable is not defined then the variable substitution will remain, so ${this.does.not.exist} would return ${this.does.not.exist}. During variable resolution the value of the variable will be path normalized by this call. If path normalization is not required use resolveRawString instead.- Parameters:
- string- the string to resolve.
- Returns:
- the resolved string
 
- 
resolveRawStringResolve the variables in the given string. This can be used either to resolve a string that contains variables in it, such as The server is called ${wlp.server.name}. or to specifically discover the value of a variable by wrapping it in ${ and } for example ${wlp.server.name}. If the variable is not defined then the variable substitution will remain, so ${this.does.not.exist} would return ${this.does.not.exist}. If path normalization of variable values is required use resolveString instead.- Parameters:
- string- the string to resolve.
- Returns:
- the resolved string
 
- 
removeVariableRemove the specified variable from the registry.- Parameters:
- variable-
 
 
-