Package org.hotswap.agent.config
Class PluginConfiguration
- java.lang.Object
-
- org.hotswap.agent.config.PluginConfiguration
-
public class PluginConfiguration extends Object
Plugin configuration. Single instance exists for each classloader.- Author:
- Jiri Bubnik
-
-
Constructor Summary
Constructors Constructor Description PluginConfiguration(ClassLoader classLoader)PluginConfiguration(PluginConfiguration parent, ClassLoader classLoader)PluginConfiguration(PluginConfiguration parent, ClassLoader classLoader, boolean init)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsPropertyFile()Does this classloader contain the property file directly, or is it acquired through parent classloader.String[]getBasePackagePrefixes()Converts watchResources property to URL array.ClassLoadergetClassLoader()Returns classloader associated with this configuration (i.e. it was initiated from).List<String>getDisabledPlugins()List of disabled plugin namesURL[]getExtraClasspath()Get extraClasspath property as URL[].StringgetProperty(String property)Get configuration property valueStringgetProperty(String property, String defaultValue)Get configuration property valuebooleangetPropertyBoolean(String property)Convenience method to get property as a boolean value using Boolean.valueOf().URL[]getWatchResources()Converts watchResources property to URL array.URL[]getWebappDir()Return configuration property webappDir as URL.protected voidinit()Initialize the configuration.booleanisDisabledPlugin(Class<?> pluginClass)Check if the plugin is disabled (in this classloader)booleanisDisabledPlugin(String pluginName)Check if the plugin is disabled (in this classloader)
-
-
-
Constructor Detail
-
PluginConfiguration
public PluginConfiguration(ClassLoader classLoader)
-
PluginConfiguration
public PluginConfiguration(PluginConfiguration parent, ClassLoader classLoader)
-
PluginConfiguration
public PluginConfiguration(PluginConfiguration parent, ClassLoader classLoader, boolean init)
-
-
Method Detail
-
init
protected void init()
Initialize the configuration.
-
getProperty
public String getProperty(String property)
Get configuration property value- Parameters:
property- property name- Returns:
- the property value or null if not defined
-
getProperty
public String getProperty(String property, String defaultValue)
Get configuration property value- Parameters:
property- property namedefaultValue- value to return if property not defined- Returns:
- the property value or null if not defined
-
getPropertyBoolean
public boolean getPropertyBoolean(String property)
Convenience method to get property as a boolean value using Boolean.valueOf().- Parameters:
property- property name- Returns:
- the property value or null if not defined
-
getExtraClasspath
public URL[] getExtraClasspath()
Get extraClasspath property as URL[].- Returns:
- extraClasspath or empty array (never null)
-
getWatchResources
public URL[] getWatchResources()
Converts watchResources property to URL array. Invalid URLs will be skipped and logged as error.
-
getBasePackagePrefixes
public String[] getBasePackagePrefixes()
Converts watchResources property to URL array. Invalid URLs will be skipped and logged as error.
-
getWebappDir
public URL[] getWebappDir()
Return configuration property webappDir as URL.
-
isDisabledPlugin
public boolean isDisabledPlugin(String pluginName)
Check if the plugin is disabled (in this classloader)
-
isDisabledPlugin
public boolean isDisabledPlugin(Class<?> pluginClass)
Check if the plugin is disabled (in this classloader)
-
getClassLoader
public ClassLoader getClassLoader()
Returns classloader associated with this configuration (i.e. it was initiated from).- Returns:
- the classloader
-
containsPropertyFile
public boolean containsPropertyFile()
Does this classloader contain the property file directly, or is it acquired through parent classloader.- Returns:
- if this contains directly the property file
-
-