Users guide
Architecture
Demo applications
Plugins
Porting Guide
Development Roles
Introduction
Administrator
Deployer
Assembler
Block Developer
Project Info
License
Mailing lists
IRC
Source repositories
Issue tracking
Blog entries
Team
|
|||||
|
|
|||||
Users guideArchitecture Development RolesIntroduction Project InfoLicense |
Creating a Block
IntroductionThis document will describe the process for creating your first component. The following steps are required before your component is ready for assembling.
Writing the ComponentWriting the component is the main task you will be called to do. It follows all the rules of writing a standard Avalon component. If a component implements the Contextualizable interface it will be passed an instance of org.apache.avalon.phoenix.BlockContext which is an extended version of org.apache.avalon.Context. Other than this minor change the container supports all the Avalon lifecycle methods. Associate MetaData with the ComponentLoom uses the same mechanism as is described in the DNA MetaData documentation. The developer should be aware that the DNA documentation describes the metadata associated with DNA components. The only difference that must be taken into account for Avalon components is the name of the methods that the attributes are associated with. For example the dna.dependency attribute must be on associated with either Avalons Composable.compose(ComponentManager) or Serviceable.service(ServiceManager) methods. The only difference is that Loom has an enhanced Ant task to generate the MetaData. This enhanced has backward compatible support for Phoenix metadata annotations and should be used if classes contain historic annotations. See below for a sample on how to use the task to generate metadata. <taskdef name="generatemeta" classname="org.codehaus.loom.info.GenerateLoomDescriptorsTask"> <classpath refid="maven-sar.class.path" /> <classpath refid="dna-tools.class.path" /> <classpath refid="metaclass.class.path" /> <classpath refid="qdox.class.path" /> </taskdef> <generatemeta dest="target/classes"> <fileset dir="src/java"> <include name="**/*.java"/> </fileset> </generatemeta> |
||||
|
Copyright 2003-2006 - The Codehaus. All rights reserved unless otherwise noted.
Powered by Atlassian Confluence
|
|||||