Apache Main | Avalon Main | Up |
Guide - Creating a BlockIntroductionThis document will describe the process for creating your first block. There are essentially three steps that must be completed before your block is ready for assembling.
Writing the Block componentWriting the Block is the main task you will be called to do. It follows all the rules of writing a standard Avalon component. If a block 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 Block's container (the Phoenix Kernel) supports all the Avalon lifecycle methods or will in the near future (at the moment suspend/resume is not yet supported). The block can implement an interface if it wishes to export a service to external blocks. It is also possible to aquire services from other blocks in the service() method. Write the BlockInfoYou must create this file to indicate which services this Block depends upon and those services which it offers. It is more fully documented in the BlockInfo Specification document. Create the jar packageThe final step is packaging up the implementation files, BlockInfos and other resources into a jar file. Guide Contents |