hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Jakarta-hivemind Wiki] Update of "NewAndNoteworthyFeaturesInAnnotationBranch" by AchimHuegen
Date Thu, 02 Nov 2006 14:07:41 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Jakarta-hivemind Wiki" for change
notification.

The following page has been changed by AchimHuegen:
http://wiki.apache.org/jakarta-hivemind/NewAndNoteworthyFeaturesInAnnotationBranch

------------------------------------------------------------------------------
  this branch: http://svn.apache.org/repos/asf/hivemind/branches/branch-2-0-annot
  
  Main goal of the branch was AnnotationSupport for HiveMind which required
- the introduction of a pure java API for registry construction.
+ the introduction of a pure java API for registry definition.
  XML support is completely encapsulated in a separate module now.
  
  == Pure Java Registry Definition API ==
  
+ The definition of service points, configuration points, contributions etc. is
+ possible now without xml. 
  More info: ["RegistryDefinitionAPI"]
  
- == Registry Autoloading ==
+ == Registry Building And Autoloading ==
+ 
+ To reflect the various possible sources for module definitions the process of 
+ building a registry has changed. 
+ Two things are needed: First of all a registry definition, which contains
+ a description of the registry with all its modules, extension points
+ and extensions. The definition is to a registry instance what a class is to an object.
+ The definition is handed over to a registry builder which is responsible
+ for consistency checks and the construction.
+ {{{
+ RegistryDefinition registryDefinition = new RegistryDefinition();
+  
+ ...  add modules, services, configurations etc.
+ 
+ RegistryBuilder builder = new RegistryBuilder(registryDefinition );
+ Registry registry = builder.constructRegistry(Locale.getDefault());
+ }}}
+ 
+ A xml module that conforms to the 1.1 HiveMind deployment descriptor schema
+ can be processed using a XmlModuleReader:
+ {{{
+ RegistryDefinition registryDefinition = new RegistryDefinition();
+ 
+ XmlModuleReader reader = new XmlModuleReader(registryDefinition);
+ reader.readClassPathModule("META-INF/hivemodule.xml");
+ reader.readClassPathModule("foo/hivemodule2.xml");
+ 
+ RegistryBuilder builder = new RegistryBuilder(registryDefinition );
+ Registry registry = builder.constructRegistry(Locale.getDefault());
+ }}}
+ 
+ That is working similar for the new annotated modules:
+ {{{
+ AnnotatedModuleReader reader = new AnnotatedModuleReader(registryDefinition);
+ reader.readModule(org.apache.hivemind.SimpleModule.class);
+ }}}
+ 
+ And finally it is possible to create the module definition by hand:
+ {{{
+ ModuleDefinition module = new ModuleDefinition("test");
+ 
+ ServicePointDefinition service1 = new ServicePointDefinition(module, "Service1",
+   null, Visibility.PUBLIC, Runnable.class.getName());
+ 
+ module.addServicePoint(service1);
+ registryDefinition.addModule(module);
+ 
+ }}}
+ 
  
  == Extensible Autowiring Service ==
  

Mime
View raw message