Class BeanConfig

    • Constructor Detail

      • BeanConfig

        public BeanConfig​(String className,
                          Properties properties)
        Creates a bean configuration. Note that a copy of the given bean properties is stored as a part of the created configuration object. Thus the caller is free to modify the given properties once the configuration object has been created.
        Parameters:
        className - class name of the bean
        properties - initial properties of the bean
      • BeanConfig

        public BeanConfig​(BeanConfig config)
        Copies a bean configuration.
        Parameters:
        config - the configuration to be copied
    • Method Detail

      • setValidate

        protected void setValidate​(boolean validate)
        Allows subclasses to control whether the configured bean property names should be validated.
        Parameters:
        validate - flag to validate the configured property names
      • setConnectionFactory

        public void setConnectionFactory​(org.apache.jackrabbit.core.util.db.ConnectionFactory connectionFactory)
        Parameters:
        connectionFactory - the ConnectionFactory to inject (if possible) in the newInstance(Class) method
      • setInstanceFactory

        public void setInstanceFactory​(BeanFactory instanceFactory)
        Parameters:
        instanceFactory - the BeanFactory to use to create bean instance
      • getClassName

        public String getClassName()
        Returns the class name of the configured bean.
        Returns:
        class name of the bean
      • getParameters

        public Properties getParameters()
        Returns the initial properties of the configured bean.
        Returns:
        initial properties of the bean
      • newInstance

        public <T> T newInstance​(Class<T> klass)
                          throws org.apache.jackrabbit.core.config.ConfigurationException
        Creates a new instance of the configured bean class.
        Returns:
        new bean instance
        Throws:
        org.apache.jackrabbit.core.config.ConfigurationException - on bean configuration errors
      • setDefaultClassLoader

        public static void setDefaultClassLoader​(ClassLoader classLoader)
        Sets the ClassLoader used for new instances of this class as the loader to instantiate objects in the newInstance(Class) method.
        Parameters:
        classLoader - The class loader to set as the default class loader. If this is null the system class loader will be used, which may lead to unexpected class loading failures.
        See Also:
        getClassLoader(), setClassLoader(ClassLoader), getDefaultClassLoader()