Package org.glassfish.config.support
Class TranslatedConfigView
- java.lang.Object
-
- org.glassfish.config.support.TranslatedConfigView
-
- All Implemented Interfaces:
InvocationHandler
,ConfigView
public class TranslatedConfigView extends Object implements ConfigView
View that translate configured attributes containing properties like ${foo.bar} into system properties values.Also support translation of Password Aliases
Also support translation of Environment Variables
- Author:
- Jerome Dochez
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TranslatedConfigView.SubstitutionType
-
Field Summary
Fields Modifier and Type Field Description static ThreadLocal<Boolean>
doSubstitution
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static String
expandConfigValue(String value)
Expand variables in string value (config usage).static String
expandValue(String value)
Expand variables in string value (non-config usage).static String
getAlias(String propName)
check if a given property name matches AS alias pattern ${ALIAS=aliasname}.ConfigView
getMasterView()
<T extends ConfigBeanProxy>
TgetProxy(Class<T> proxyType)
<T extends ConfigBeanProxy>
Class<T>getProxyType()
static String
getRealPasswordFromAlias(String at)
Object
invoke(Object proxy, Method method, Object[] args)
static void
setHabitat(org.glassfish.hk2.api.ServiceLocator h)
void
setMasterView(ConfigView view)
-
-
-
Field Detail
-
doSubstitution
public static final ThreadLocal<Boolean> doSubstitution
-
-
Method Detail
-
expandValue
public static String expandValue(String value)
Expand variables in string value (non-config usage). This expansion can be disabled by system propertyfish.payara.substitution.disable
, and should be used by any code that handles deployment descriptors, where this constitutes a non-standard behavior.- Parameters:
value
- value to be expanded- Returns:
- expanded value or
null
when value is null. Original value when substitution is disabled.
-
expandConfigValue
public static String expandConfigValue(String value)
Expand variables in string value (config usage). This method should be called when expanding values from config, where substitution is necessary at all times.- Parameters:
value
- value to be expanded- Returns:
- expanded value or
null
when value is null.
-
setHabitat
public static void setHabitat(org.glassfish.hk2.api.ServiceLocator h)
-
getAlias
public static String getAlias(String propName)
check if a given property name matches AS alias pattern ${ALIAS=aliasname}. if so, return the aliasname, otherwise return null.- Parameters:
propName
- The property name to resolve. ex. ${ALIAS=aliasname}.- Returns:
- The aliasname or null.
-
getRealPasswordFromAlias
public static String getRealPasswordFromAlias(String at) throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException, UnrecoverableKeyException
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
getMasterView
public ConfigView getMasterView()
- Specified by:
getMasterView
in interfaceConfigView
-
setMasterView
public void setMasterView(ConfigView view)
- Specified by:
setMasterView
in interfaceConfigView
-
getProxyType
public <T extends ConfigBeanProxy> Class<T> getProxyType()
- Specified by:
getProxyType
in interfaceConfigView
-
getProxy
public <T extends ConfigBeanProxy> T getProxy(Class<T> proxyType)
- Specified by:
getProxy
in interfaceConfigView
-
-