Class PluginConfiguration


  • public class PluginConfiguration
    extends Object
    Plugin configuration.

    Single instance exists for each classloader.

    Author:
    Jiri Bubnik
    • 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 name
        defaultValue - 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.
      • getDisabledPlugins

        public List<String> getDisabledPlugins()
        List of disabled plugin names
      • 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