Support for PluginFactory

Pull request based on this issue: https://issues.apache.org/jira/browse/CB-6384