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 classTranslatedConfigView.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 StringexpandConfigValue(String value)Expand variables in string value (config usage).static StringexpandValue(String value)Expand variables in string value (non-config usage).static StringgetAlias(String propName)check if a given property name matches AS alias pattern ${ALIAS=aliasname}.ConfigViewgetMasterView()<T extends ConfigBeanProxy>
TgetProxy(Class<T> proxyType)<T extends ConfigBeanProxy>
Class<T>getProxyType()static StringgetRealPasswordFromAlias(String at)Objectinvoke(Object proxy, Method method, Object[] args)static voidsetHabitat(org.glassfish.hk2.api.ServiceLocator h)voidsetMasterView(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
nullwhen 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
nullwhen 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:
invokein interfaceInvocationHandler- Throws:
Throwable
-
getMasterView
public ConfigView getMasterView()
- Specified by:
getMasterViewin interfaceConfigView
-
setMasterView
public void setMasterView(ConfigView view)
- Specified by:
setMasterViewin interfaceConfigView
-
getProxyType
public <T extends ConfigBeanProxy> Class<T> getProxyType()
- Specified by:
getProxyTypein interfaceConfigView
-
getProxy
public <T extends ConfigBeanProxy> T getProxy(Class<T> proxyType)
- Specified by:
getProxyin interfaceConfigView
-
-