GBuild
Added by David Blevins, last edited by David Blevins on Jan 07, 2006  (view change)
Labels: 
(None)


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.

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.

The Interface

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);
   
   }

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.

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).

<component>
   <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
   <role-hint>foo-bar</role-hint>
   <implementation>org.apache.geronimo.gbuild.agent.FooBarExtension</implementation>
   </component>

Implementations

The following BuildAgentExtensions exist:

  • [BuildOutputExtension]
  • [FileIncludeExtension]
  • HeaderIncludeExtension
  • [KillProcessesExtension]
  • [ReportActivityExtension]

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.

The Interface

BuildAgentExtention.java
package org.apache.geronimo.gbuild.agent;
   
   public interface BuildResultsExtension {
   
   void execute(java.util.Map context) throws java.lang.Exception;
   
   }

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.

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.

<component>
   <role>org.apache.geronimo.gbuild.agent.BuildResultsExtension</role>
   <role-hint>foo-bar</role-hint>
   <implementation>org.apache.geronimo.gbuild.agent.FooBarResultsExtension</implementation>
   </component>

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