Class ConfigModularityUtils
java.lang.Object
com.sun.enterprise.config.modularity.ConfigModularityUtils
Contains utility methods for zero-config
- Author:
- Masoud Kalali
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid<T extends org.jvnet.hk2.config.ConfigBeanProxy>
voidapplyCustomTokens(ConfigBeanDefaultValue configBeanDefaultValue, T finalConfigBean, org.jvnet.hk2.config.ConfigBeanProxy parent) booleancheckInterfaces(Class[] ifs, Type actualGenericParameter) convert a configuration element name to representing class namebooleandeleteConfigurationForConfigBean(org.jvnet.hk2.config.ConfigBeanProxy configBean, Collection col, ConfigBeanDefaultValue defaultValue) findDeeperSuitableCollectionGetter(Class owner, Class typeToSet) findSuitableCollectionGetter(Class owner, Class typeToSet) Find a getter method that returns a collection of the type we want to put set.getAnnotatedConfigBeans(Class annotationType) getClassFor(String serviceName) getClassForFullName(String configBeanClassName) getClassFromDescriptor(org.glassfish.hk2.api.ActiveDescriptor<?> descriptor) getClassFromInjector(org.jvnet.hk2.config.ConfigInjector injector) <T extends org.jvnet.hk2.config.ConfigBeanProxy>
TgetConfigBeanFromCollection(Collection<T> col, T configBeanObject, Class typeOfObjects) org.jvnet.hk2.config.ConfigBeanProxygetConfigBeanInstanceFor(Class configBeanType) <U extends org.jvnet.hk2.config.ConfigBeanProxy>
URLgetConfigurationFileUrl(Class<U> configBeanClass, String baseFileName, String runtimeType) <T extends org.jvnet.hk2.config.ConfigBeanProxy>
TgetCurrentConfigBeanForDefaultValue(ConfigBeanDefaultValue defaultValue) getDefaultConfigurations(Class configBeanClass, String runtimeType) If exists, locate and return a URL to the configuration snippet for the given config bean class.<U extends org.jvnet.hk2.config.ConfigBeanProxy>
List<U>getExtensions(org.jvnet.hk2.config.ConfigBeanProxy parent) getGetDefaultValuesMethod(Class<?> configBeanType) getInstalledExtensions(Class extensionType) getMatchingGetterMethod(Class classToQuery, Class methodReturnType) Find a suitable getter method in the given class. the returned method represent a method that will return back a type of methodReturnType.getMatchingSetterMethod(Class classToQuery, Class typeToSet) Finds and return the setter method matching the class identified by typeToSet<T extends org.jvnet.hk2.config.ConfigBeanProxy>
TgetNamedConfigBeanFromCollection(Collection<T> col, String nameToLookFor, Class typeOfObjects) getNameForConfigBean(Object configBean, Class configBeanType) org.jvnet.hk2.config.ConfigBeanProxygetOwningClassForLocation(String location) org.jvnet.hk2.config.ConfigBeanProxygetOwningObject(String location) getPropertyValue(ConfigCustomizationToken token, org.jvnet.hk2.config.ConfigBeanProxy finalConfigBean) getRuntimeTypePrefix(com.sun.enterprise.module.bootstrap.StartupContext startupContext) getServiceTypeNameIfNamedComponent(String serviceName) booleanhasCustomConfig(Class configBeanClass) booleanbooleanreplacePropertiesWithCurrentValue(String xmlConfiguration, ConfigBeanDefaultValue value) resolveExpression(String expression) serializeConfigBean(org.jvnet.hk2.config.ConfigBeanProxy configBean) serializeConfigBeanByType(Class configBeanType) voidsetCommandInvocation(boolean commandInvocation) <T extends org.jvnet.hk2.config.ConfigBeanProxy>
TsetConfigBean(T finalConfigBean, ConfigBeanDefaultValue configBeanDefaultValue, org.jvnet.hk2.config.ConfigBeanProxy parent) voidsetIgnorePersisting(boolean ignorePersisting) <T extends org.jvnet.hk2.config.ConfigBeanProxy>
booleanstackPositionHigher(T finalConfigBean, org.jvnet.hk2.config.ConfigBeanProxy itemToRemove)
-
Constructor Details
-
ConfigModularityUtils
public ConfigModularityUtils()
-
-
Method Details
-
getConfigurationFileUrl
-
getDefaultConfigurations
public List<ConfigBeanDefaultValue> getDefaultConfigurations(Class configBeanClass, String runtimeType) If exists, locate and return a URL to the configuration snippet for the given config bean class.- Parameters:
configBeanClass- the config bean type we want to check for its configuration snippet- Returns:
- A url to the file or null of not exists
-
hasCustomConfig
-
findSuitableCollectionGetter
Find a getter method that returns a collection of the type we want to put set.- Parameters:
owner- The class we want to search to find a method that returns a Collection typed with toSetTypetypeToSet- The type we want to find a matching collection fo- Returns:
- The Method that
-
findDeeperSuitableCollectionGetter
-
checkInterfaces
-
getOwningClassForLocation
-
getOwningObject
-
getOwner
public org.jvnet.hk2.config.ConfigBeanProxy getOwner(org.jvnet.hk2.config.ConfigBeanProxy parent, String parentElement, String childElement) throws InvocationTargetException, IllegalAccessException -
getExtensions
public <U extends org.jvnet.hk2.config.ConfigBeanProxy> List<U> getExtensions(org.jvnet.hk2.config.ConfigBeanProxy parent) -
setConfigBean
public <T extends org.jvnet.hk2.config.ConfigBeanProxy> T setConfigBean(T finalConfigBean, ConfigBeanDefaultValue configBeanDefaultValue, org.jvnet.hk2.config.ConfigBeanProxy parent) -
stackPositionHigher
public <T extends org.jvnet.hk2.config.ConfigBeanProxy> boolean stackPositionHigher(T finalConfigBean, org.jvnet.hk2.config.ConfigBeanProxy itemToRemove) -
applyCustomTokens
public <T extends org.jvnet.hk2.config.ConfigBeanProxy> void applyCustomTokens(ConfigBeanDefaultValue configBeanDefaultValue, T finalConfigBean, org.jvnet.hk2.config.ConfigBeanProxy parent) throws org.jvnet.hk2.config.TransactionFailure, PropertyVetoException - Throws:
org.jvnet.hk2.config.TransactionFailurePropertyVetoException
-
addSystemPropertyForToken
public void addSystemPropertyForToken(List<ConfigCustomizationToken> tokens, SystemPropertyBag bag) throws org.jvnet.hk2.config.TransactionFailure, PropertyVetoException - Throws:
org.jvnet.hk2.config.TransactionFailurePropertyVetoException
-
getCurrentConfigBeanForDefaultValue
public <T extends org.jvnet.hk2.config.ConfigBeanProxy> T getCurrentConfigBeanForDefaultValue(ConfigBeanDefaultValue defaultValue) throws InvocationTargetException, IllegalAccessException -
getConfigBeanFromCollection
public <T extends org.jvnet.hk2.config.ConfigBeanProxy> T getConfigBeanFromCollection(Collection<T> col, T configBeanObject, Class typeOfObjects) throws InvocationTargetException, IllegalAccessException -
getNamedConfigBeanFromCollection
public <T extends org.jvnet.hk2.config.ConfigBeanProxy> T getNamedConfigBeanFromCollection(Collection<T> col, String nameToLookFor, Class typeOfObjects) throws InvocationTargetException, IllegalAccessException -
getNameForConfigBean
public String getNameForConfigBean(Object configBean, Class configBeanType) throws InvocationTargetException, IllegalAccessException -
convertConfigElementNameToClassName
convert a configuration element name to representing class name- Parameters:
name- the configuration element name we want to convert to class name- Returns:
- the class name which the configuration element represent.
-
getClassFor
-
getClassFromInjector
-
getServiceTypeNameIfNamedComponent
-
resolveExpression
-
serializeConfigBeanByType
-
getConfigBeanInstanceFor
-
serializeConfigBean
-
getMatchingGetterMethod
Find a suitable getter method in the given class. the returned method represent a method that will return back a type of methodReturnType.- Parameters:
classToQuery- The class we want to find the getter inmethodReturnType- the type we want to find the getter for- Returns:
- A Method object for a getter method in the classToQuery which returns the methodReturnType
-
getMatchingSetterMethod
Finds and return the setter method matching the class identified by typeToSet- Parameters:
classToQuery- The ConfigLoader we want to inspect for presence of a setter method accepting class of type fqcn.typeToSet- the type we want to find a setter for- Returns:
- the matching Method object or null if not present.
-
getGetDefaultValuesMethod
-
deleteConfigurationForConfigBean
public boolean deleteConfigurationForConfigBean(org.jvnet.hk2.config.ConfigBeanProxy configBean, Collection col, ConfigBeanDefaultValue defaultValue) -
getClassForFullName
-
getClassFromDescriptor
-
replacePropertiesWithCurrentValue
public String replacePropertiesWithCurrentValue(String xmlConfiguration, ConfigBeanDefaultValue value) throws InvocationTargetException, IllegalAccessException -
getPropertyValue
public String getPropertyValue(ConfigCustomizationToken token, org.jvnet.hk2.config.ConfigBeanProxy finalConfigBean) -
getRuntimeTypePrefix
public String getRuntimeTypePrefix(com.sun.enterprise.module.bootstrap.StartupContext startupContext) -
getAnnotatedConfigBeans
-
isIgnorePersisting
public boolean isIgnorePersisting() -
setIgnorePersisting
public void setIgnorePersisting(boolean ignorePersisting) -
isCommandInvocation
public boolean isCommandInvocation() -
setCommandInvocation
public void setCommandInvocation(boolean commandInvocation) -
getInstalledExtensions
-