Dashboard > GBuild > Home > Extensions > Information > Page Comparison
Extensions
compared with
Current by David Blevins
on Jan 07, 2006 02:31.

(show comment)
 
Key
These lines were removed. This word was removed.
These lines were added. This word was added.

View page history


There are 2 changes. View first change.

 The GBuild Agent has a few extention points that make it fairly easy to do special processing around events in the system across the various machines in the network.
  
 h1. BuildAgentExtension
  
 {anchor:BuildAgentExtension}
  
 The mechanism to extend an Agent that processes messages on the BUILD.TASKS queue. There are typically several of these Agents (one per machine in the network usually) and each can be configured with any number of BuildAgentExtensions.
  
 h2. The Interface
  
 {code:title=BuildAgentExtention.java}
 package org.apache.geronimo.gbuild.agent;
  
 import java.util.Map;
  
 public interface BuildAgentExtension {
  
  public void preProcess(Map build);
  
  public void postProcess(Map build, Map results);
  
 }
 {code}
  
 The *preProcess* method is called before the Agent runs the build task defined by the Map passed in as a parameter. The extention could modify/add/remove values in the map as well as perform any actions needed before the build agent can run the build definition.
  
 The *postProcess* method is called after the Agent has run the build task in the map. The first Map parameter is the map that was pulled from the BUILD.TASKS queue. The second parameter is the map containing the results that will be pushed on to the BUILD.RESULTS topic.
  
 h2. Declaring a BuildAgentExtension
  
 An xml snippet like the following in the [application.xml] of the Agent is enough to declare a BuildAgentExtension. These are aggregated by the BuildAgentExtentionManager component which holds them in a map keyed by role-hint. A role-hint is a plexus thing that more or less allows you to refer to components by name (role-hint) aside from just type (role).
  
 {code:xml}
 <component>
  <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
  <role-hint>foo-bar</role-hint>
  <implementation>org.apache.geronimo.gbuild.agent.FooBarExtension</implementation>
 </component>
 {code}
  
 h2. Implementations
  
 The following BuildAgentExtensions exist:
  
 - [BuildOutputExtension]
 - [FileIncludeExtension]
 - [HeaderIncludeExtension]
 - [KillProcessesExtension]
 - [ReportActivityExtension]
  
 h1. BuildResultsExtension
  
 {anchor:BuildResultsExtension}
  
 The mechanism to extend an Agent that processes messages on the BUILD.RESULTS queue. There can be as many of these as needed or desired. Since the results go onto a JMS Topic there really is no limit to the number of Agents "listening" on the BUILD.RESULTS topic and processing things in any number of ways, including to writing data to a database, doing analysis of failures and performance over a period of time, specific kinds of reporting, etc.
  
 h2. The Interface
  
 {code:title=BuildAgentExtention.java}
 package org.apache.geronimo.gbuild.agent;
  
 public interface BuildResultsExtension {
  
  void execute(java.util.Map context) throws java.lang.Exception;
  
 }
 {code}
  
 The *execute* method is called when a message is received on the BUILD.RESULTS topic by a BuildResultsContinuumAgent. The map passed in is the HashMap containing the results of a build as produced by a ContinuumBuildAgent.
  
 h2. Declaring a BuildAgentExtension
  
 An xml snippet like the following in the [application.xml] of the Agent is enough to declare a BuildResultsExtension. These are aggregated by the BuildResultsExtensionManager component which holds them in a map keyed by role-hint.
  
 {code:xml}
 <component>
  <role>org.apache.geronimo.gbuild.agent.BuildResultsExtension</role>
  <role-hint>foo-bar</role-hint>
  <implementation>org.apache.geronimo.gbuild.agent.FooBarResultsExtension</implementation>
 </component>
 {code}
  
 h2. Implementations
  
 The following BuildResultsExtensions exist
  
 - [LogFailedBuildsExtension]
 - [WriteIncludeFileExtension]
  
Site running on a free Atlassian Confluence Open Source Project License granted to OSS. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.5 Build:#811 Jul 25, 2007) - Bug/feature request - Contact Administrators