Porting from HiveMind to Gaderian
Porting from HiveMind To Gaderian
This document hopes to outline some of the things you need to do in order to port you current application from HiveMind to Gaderian.
Major Changes from HiveMind to Gaderian
All features of Gaderian reflect those of the current HiveMind trunk (v1.X). This means that most work in porting involves simply changing imports and contributions within descriptor files.
Default location of Descriptor files
The default location and name of the descriptor file has changed from META-INF/hivemodule.xml to META-INF/org/ops4j/gaderian/module.xml
The reason for moving/renaming the descriptor was two-fold. Firstly, we wanted to change the name of the file to reflect the project change Gaderian, and secondly (and more importantly) we wanted to move the file out of a more and more clogged up META-INF directory.
By moving the location to META-INF/org/ops4j/gaderian, we move descriptors relevant to Gaderian out of this crowded location and into it's own namespace.
Steps for Porting
- Rename all contributions to hivemind.lib to gaderian.utilities
- Rename all contributions to hivemind. to gaderian.
- Change all imports within your code from org.apache.hivemind.lib to org.ops4j.gaderian.utilities
- Change all imports within your code from org.apache.hivemind. to org.ops4j.gaderian.
Using HiveMind Descriptors with Gaderian
If so preferred, you can still load your existing descriptors in Gaderian. To do so, simply use the follwing piece of code:
| Although you can use your descriptors in their current, Hivemind style, locations, you will still need to rename any contributions inside these files to use Gaderian namespaces |
// Create a new instance of the registry builder RegistryBuilder registryBuilder = new RegistryBuilder(); // Add the default, Gaderian module desciptors (in their defualt location META-INF/org/ops4j/gaderian/module.xml) registryBuilder.addDefaultModuleDescriptorProvider(); // Next, add all descriptors located in the old META-INF/hivemodule.xml locations registryBuilder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(new DefaultClassResolver(),"META-INF/hivemodule.xml")); // And finally, construct the registry as usual Registry registry = registryBuilder.constructRegistry(Locale.getDefault());
Migrating to v.1.1
As of version 1.1 of Gaderian, many services which previously resided in the Utilities module has been migrated to the Core module. To move to use these services from Core, simply drop the utilities part from the service id.
Listed below are the services migrated from Utilities to Core:
- BeanFactoryBuilder
- BeanFactoryObjectProvider
- PipelineFactory
- ServicePropertyFactory
- StrategyFactory
- ChainBuilder
- ChainFactory
- DefaultImplementationBuilder
- PlaceholderFactory
- JavaProxyFactory
Any related schemas and configuration points have also been moved