ModeShape/modeshape — pull request #589 by rhauch (2012-11-05 22:39:31+00:00)
Title: Enhancements to the federation framework (configuration, management, etc.) 

Horia, all of these changes are based upon your [original pull-request](https://github.com/ModeShape/modeshape/pull/587). After reviewing and if everything is acceptable, you should be able to merge my one commit onto your local branch and update your pull-request. If not acceptable, comment and we can discuss, and I can rebase based upon your branch (perhaps with additional commits).

This pull-request changes several things:

- Connectors can now be configured within a repository's configuration; documents reflecting each connector's configuration (e.g., classname, classloader, connector-specific properties) appears as a value in the field named by the connector under the "storage/connectors" document. The 'repo-config-federation.json' test configuration was updated to configure the MockConnector.
- MockConnector is now a separate (deprecated) class, and is configured like any other connector (via the configuration file) and thus is no longer hard-coded.
- ConnectorsManager was renamed to Connectors (following the same pattern for the existing Sequencers container class) and moved into the 'org.modeshape.jcr' package so it can be initialized with JcrRepository.RunningState (again, like Sequencers) through which the Connectors class can access the repository's ExecutionContext, MIME type detector, and other components. Connectors can still be added and removed dynamically (though this is not yet supported in the JcrRepository.RunningState constructor) via 'addConnector(Component)' that reuses the same RepositoryConfiguration.Component used by RepositoryConfiguration for sequencers, text extractors, and other components. Connectors are removed by name.
- Connector is now abstract and contains quite a few helper methods, including methods to create document builders (now an interface), names, and to return the value factories (which connectors will use to create property values). Connector also has lifecycle methods (e.g., initialize and shutdown) that are called by the Connectors class. Several private fields are also initialized (reflectively) by the Connectors class.
- FileSystemConnector is a new, initial implementation of a connector that accesses the file system. It is still relatively crude (and untested), and doesn't yet support extra properties like in 2.x (not sure we want to do this, although several 2.x users were leveraging this feature).