geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r397693 - in /geronimo/gbuild/trunk: ./ extensions/ extensions/requeue-failed/ extensions/requeue-failed/src/ extensions/requeue-failed/src/main/ extensions/requeue-failed/src/main/java/ extensions/requeue-failed/src/main/java/org/ extensio...
Date Fri, 28 Apr 2006 00:45:04 GMT
Author: dblevins
Date: Thu Apr 27 17:45:01 2006
New Revision: 397693

URL: http://svn.apache.org/viewcvs?rev=397693&view=rev
Log:
Fix for http://issues.apache.org/jira/browse/GBUILD-2
Builds will now be requeued and marked with a list of hosts that have pulled 
and failed the build.


Added:
    geronimo/gbuild/trunk/extensions/
    geronimo/gbuild/trunk/extensions/pom.xml
    geronimo/gbuild/trunk/extensions/requeue-failed/
    geronimo/gbuild/trunk/extensions/requeue-failed/pom.xml
    geronimo/gbuild/trunk/extensions/requeue-failed/src/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/RequeueFailedBuilds.java
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/
      - copied from r395964, geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/plexus/
      - copied from r397692, geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/test/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/test/java/
    geronimo/gbuild/trunk/extensions/requeue-failed/src/test/resources/
Modified:
    geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/plexus/components.xml
    geronimo/gbuild/trunk/gbuild-agent-application/pom.xml
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java
    geronimo/gbuild/trunk/pom.xml

Added: geronimo/gbuild/trunk/extensions/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/extensions/pom.xml?rev=397693&view=auto
==============================================================================
--- geronimo/gbuild/trunk/extensions/pom.xml (added)
+++ geronimo/gbuild/trunk/extensions/pom.xml Thu Apr 27 17:45:01 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.gbuild</groupId>
+        <artifactId>gbuild-parent</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <groupId>org.apache.geronimo.gbuild.extension</groupId>
+    <artifactId>extensions</artifactId>
+    <name>GBuild Agent Extensions</name>
+    <packaging>pom</packaging>
+    <url>http://geronimo.apache.org</url>
+
+    <modules>
+        <module>requeue-failed</module>
+    </modules>
+
+</project>

Added: geronimo/gbuild/trunk/extensions/requeue-failed/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/extensions/requeue-failed/pom.xml?rev=397693&view=auto
==============================================================================
--- geronimo/gbuild/trunk/extensions/requeue-failed/pom.xml (added)
+++ geronimo/gbuild/trunk/extensions/requeue-failed/pom.xml Thu Apr 27 17:45:01 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id$ -->
+
+<project>
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.gbuild.extension</groupId>
+        <artifactId>extensions</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>requeue-failed</artifactId>
+    <name>GBuild Extension: Requeue Failed Builds</name>
+    <packaging>jar</packaging>
+    <url>http://geronimo.apache.org</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.gbuild</groupId>
+            <artifactId>gbuild-agent</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+    </dependencies>
+</project>

Added: geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/RequeueFailedBuilds.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/RequeueFailedBuilds.java?rev=397693&view=auto
==============================================================================
--- geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/RequeueFailedBuilds.java
(added)
+++ geronimo/gbuild/trunk/extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/RequeueFailedBuilds.java
Thu Apr 27 17:45:01 2006
@@ -0,0 +1,187 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.gbuild.extension.requeue;
+
+import org.apache.geronimo.gbuild.agent.AbstractContinuumAgentAction;
+import org.apache.geronimo.gbuild.agent.BuildAgentExtension;
+import org.apache.geronimo.gbuild.agent.BuildResultsExtension;
+import org.apache.geronimo.gbuild.agent.ClientManager;
+import org.apache.geronimo.gbuild.agent.BuildActivityNotifier;
+import org.apache.geronimo.gbuild.agent.ContinuumBuildAgent;
+import org.apache.geronimo.gbuild.agent.StringTemplate;
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.model.project.Project;
+import org.apache.maven.continuum.store.ContinuumStore;
+import org.apache.maven.continuum.store.ContinuumStoreException;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import javax.jms.Session;
+import javax.jms.Queue;
+import javax.jms.MessageProducer;
+import javax.jms.DeliveryMode;
+import javax.jms.ObjectMessage;
+import javax.jms.JMSException;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.ArrayList;
+
+/**
+ * Decided to put the BuildAgentExtension and BuildResultsExtension both in this class
+ * due to the symmetrical nature of them.  They largely complete the same task, simply
+ * the task is started on one machine and completed on another.  Client and Server if
+ * you want to think of it that way.
+ *
+ * @version $Rev$ $Date$
+ */
+public class RequeueFailedBuilds extends AbstractLogEnabled {
+
+    public static final String PREFIX = RequeueFailedBuilds.class.getName() + "@";
+    public static final String BUILD_TASK = PREFIX + "build-task";
+    public static final String HOSTS_LIST = PREFIX + "hosts-list";
+
+    public int getExitCode(Map context) {
+        try {
+            ContinuumStore store = AbstractContinuumAgentAction.getContinuumStore(context);
+
+            int projectId = AbstractContinuumAction.getProjectId(context);
+
+            Project project = store.getProject(projectId);
+
+            BuildResult buildResult = store.getBuildResult(project.getLatestBuildId());
+
+            return buildResult.getExitCode();
+        } catch (ContinuumStoreException e) {
+            getLogger().error("Unable to use continuum store.", e);
+            return -1;
+        }
+    }
+
+    public static class AgentExtension extends RequeueFailedBuilds implements BuildAgentExtension
{
+        public static void main(String[] args) {
+            String name = AgentExtension.class.getName();
+            System.out.println("name = " + name);
+        }
+        public void preProcess(Map build) {
+        }
+
+        public void postProcess(Map build, Map results) {
+            if (getExitCode(results) != 0) {
+                results.put(BUILD_TASK, new HashMap(build));
+            }
+        }
+    }
+
+    public static class ResultsExtension extends RequeueFailedBuilds implements BuildResultsExtension
{
+        /**
+         * @plexus.requirement
+         */
+        private ClientManager clientManager;
+
+        /**
+         * @plexus.requirement
+         */
+        private BuildActivityNotifier notifier;
+
+        /**
+         * @plexus.configuration
+         */
+        private String buildTaskQueue;
+
+        /**
+         * @plexus.configuration
+         */
+        private int maxRequeue;
+
+        private StringTemplate failedLogMessage = new StringTemplate("Unable to requeue failed
build: [{host-name}:{host-address}] {project.name}-{project.version} - {build.name} {build.id}");
+
+        private StringTemplate failedNotification = new StringTemplate("Unable to requeue
failed build from [{host-name}:{host-address}] - {os.name} {os.version}");
+
+        private StringTemplate requeuedMessage = new StringTemplate("Requeued: Agent info
[{host-name}:{host-address}] - {os.name} {os.version}");
+
+        private StringTemplate requeueNotPossible = new StringTemplate("Discarding - Requeue
Not Possible: Agent info [{host-name}:{host-address}] - {os.name} {os.version}");
+
+        private StringTemplate maxRetriesExceeded = new StringTemplate("Discarding - Max
Retries Exceeded: Agent info [{host-name}:{host-address}] - {os.name} {os.version}");
+
+        public void execute(Map results) throws Exception {
+            if (getExitCode(results) == 0) {
+                return;
+            }
+
+            HashMap buildTask = (HashMap) results.get(BUILD_TASK);
+
+            if (buildTask == null) {
+
+                notifier.sendNotification(results, requeueNotPossible.apply(results));
+
+                return;
+            }
+
+            ArrayList hostsList = (ArrayList) buildTask.get(HOSTS_LIST);
+
+            if (hostsList == null){
+                hostsList = new ArrayList();
+            }
+
+            String failedOnHost = getHostName(results);
+
+            hostsList.add(failedOnHost);
+
+            if (hostsList.size() >= maxRequeue) {
+
+                notifier.sendNotification(results, maxRetriesExceeded.apply(results));
+
+                return;
+            }
+
+            try{
+                Session session = clientManager.getClient().getSession();
+
+                Queue buildQueue = session.createQueue(buildTaskQueue);
+
+                MessageProducer producer = session.createProducer(buildQueue);
+
+                producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
+                ObjectMessage message = session.createObjectMessage(buildTask);
+
+                for (int i = 0; i < hostsList.size(); i++) {
+
+                    String hostName = (String) hostsList.get(i);
+
+                    message.setStringProperty(hostName, "exclude");
+                }
+
+                producer.send(message);
+
+                notifier.sendNotification(buildTask, requeuedMessage.apply(results));
+
+            } catch (JMSException e) {
+
+                getLogger().error(failedLogMessage.apply(results));
+
+            } catch (Exception e) {
+
+                notifier.sendNotification(results, failedNotification.apply(results));
+            }
+        }
+
+        private String getHostName(Map results) {
+            return (String) results.get(ContinuumBuildAgent.KEY_HOST_NAME);
+        }
+    }
+}

Modified: geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/plexus/components.xml?rev=397693&r1=397692&r2=397693&view=diff
==============================================================================
--- geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/plexus/components.xml
(original)
+++ geronimo/gbuild/trunk/extensions/requeue-failed/src/main/resources/META-INF/plexus/components.xml
Thu Apr 27 17:45:01 2006
@@ -2,291 +2,26 @@
   <components>
 
     <component>
-      <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
-      <implementation>org.apache.geronimo.gbuild.agent.ClientManager</implementation>
-      <configuration>
-        <broker-url>tcp://localhost:61616</broker-url>
-        <ping-interval>300000</ping-interval>
-        <reconnect-attempts>10</reconnect-attempts>
-        <reconnect-delay>600000</reconnect-delay>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgent</role>
-      <role-hint>build-executor</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.ContinuumBuildAgent</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.BuildAgentExtentionManager</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.buildcontroller.BuildController</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <contributor>Unknown</contributor>
-        <admin-address>scm@geronimo.apache.org</admin-address>
-        <build-task-queue>BUILD.TASKS</build-task-queue>
-        <build-results-topic>BUILD.RESULTS</build-results-topic>
-        <working-directory>agent/work</working-directory>
-        <build-output-directory>agent/output</build-output-directory>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.codehaus.plexus.action.Action</role>
-      <role-hint>execute-builder</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.ExecuteDistributedBuilderContinuumAction</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.execution.manager.BuildExecutorManager</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.notification.ContinuumNotificationDispatcher</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
-      <role>org.apache.maven.continuum.store.ContinuumStore</role>
-      <role-hint>agent-store</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.ThreadContextContinuumStore</implementation>
-    </component>
-
-    <component>
-      <role>org.apache.maven.continuum.notification.ContinuumNotificationDispatcher</role>
-      <!--<role-hint>agent-notifier</role-hint>-->
-      <implementation>org.apache.geronimo.gbuild.agent.MockContinuumNotificationDispatcher</implementation>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgentExtentionManager</role>
-      <implementation>org.apache.geronimo.gbuild.agent.DefaultBuildAgentExtensionManager</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
-          <field-name>extentions</field-name>
-        </requirement>
-      </requirements>
-    </component>
-
-    <component>
       <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
-      <role-hint>file-include</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.FileIncludeExtension</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <pattern>^include</pattern>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
-      <role-hint>general-headers</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.HeaderIncludeExtension</implementation>
-      <configuration>
-        <pattern>^(project|build|header).*</pattern>
-      </configuration>
-    </component>
-
-
-    <!--
-    | Build Producer
-    -->
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgent</role>
-      <role-hint>build-producer</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.PropertiesBuildTaskProducer</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <build-task-queue>BUILD.TASKS</build-task-queue>
-        <include-prefix>include.</include-prefix>
-        <header-prefix>header.</header-prefix>
-        <watch-directory>tasks</watch-directory>
-        <poll-interval>10000</poll-interval>
-      </configuration>
-    </component>
-
-
-    <!--
-    | Build Producer
-    -->
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildQueueReloader</role>
-      <role-hint>build-producer</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.BuildQueueReloader</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <build-task-queue>BUILD.TASKS</build-task-queue>
-        <tasks-directory>tasks</tasks-directory>
-        <poll-interval>30</poll-interval>
-      </configuration>
-    </component>
-
-    <!--
-    | Build Results
-    -->
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgent</role>
-      <role-hint>build-results</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.BuildResultsContinuumAgent</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.BuildResultsExtensionManager</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <build-results-topic>BUILD.RESULTS</build-results-topic>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildResultsExtensionManager</role>
-      <implementation>org.apache.geronimo.gbuild.agent.DefaultBuildResultsExtensionManager</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.BuildResultsExtension</role>
-          <field-name>extentions</field-name>
-        </requirement>
-      </requirements>
+      <role-hint>requeue-failed</role-hint>
+      <implementation>org.apache.geronimo.gbuild.extension.requeue.RequeueFailedBuilds$AgentExtension</implementation>
     </component>
 
     <component>
       <role>org.apache.geronimo.gbuild.agent.BuildResultsExtension</role>
-      <role-hint>write-include-file</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.WriteIncludeFileExtension</implementation>
-      <configuration>
-        <include-pattern>^include.*</include-pattern>
-        <results-directory>results</results-directory>
-        <date-format>yyyy-MM</date-format>
-        <file-name-template>{date}/{project.name}/{project.version}/{build.name}-{build.id}.properties</file-name-template>
-      </configuration>
-    </component>
-
-
-    <!--
-    | Ping monitor
-    -->
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgent</role>
-      <role-hint>ping-monitor</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.PingMonitorAgent</implementation>
+      <role-hint>requeue-failed</role-hint>
+      <implementation>org.apache.geronimo.gbuild.extension.requeue.RequeueFailedBuilds$ResultsExtension</implementation>
       <requirements>
         <requirement>
           <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
         </requirement>
-      </requirements>
-    </component>
-
-    <!--
-    | Build Activity
-    -->
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgent</role>
-      <role-hint>build-activity</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.BuildActivityMonitor</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <log-format>[{host-name}:{host-address}] {project.name}-{project.version} -
{build.name} {build.id} - {notification}</log-format>
-        <build-activity-topic>BUILD.ACTIVITY</build-activity-topic>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildActivityNotifier</role>
-      <role-hint>ping-monitor</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.BuildActivityNotifier</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <build-activity-topic>BUILD.ACTIVITY</build-activity-topic>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
-      <role-hint>report-activity</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.ReportActivityExtension</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-        </requirement>
         <requirement>
           <role>org.apache.geronimo.gbuild.agent.BuildActivityNotifier</role>
         </requirement>
       </requirements>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
-      <role-hint>clean-dead-processes</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.KillProcessesExtension</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.geronimo.gbuild.agent.BuildActivityNotifier</role>
-        </requirement>
-      </requirements>
-      <configuration>
-        <regex>.*geronimo-tck.*</regex>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildAgentExtension</role>
-      <role-hint>build-output</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.BuildOutputExtension</implementation>
-      <requirements>
-        <requirement>
-          <role>org.apache.maven.continuum.configuration.ConfigurationService</role>
-        </requirement>
-        <requirement>
-          <role>org.apache.maven.continuum.store.ContinuumStore</role>
-        </requirement>
-      </requirements>
       <configuration>
-      </configuration>
-    </component>
-
-    <component>
-      <role>org.apache.geronimo.gbuild.agent.BuildResultsExtension</role>
-      <role-hint>log-failed-build-file</role-hint>
-      <implementation>org.apache.geronimo.gbuild.agent.LogFailedBuildsExtension</implementation>
-      <configuration>
-        <results-directory>${plexus.home}/failed</results-directory>
-        <date-format>yyyy-MM-dd-HHmm</date-format>
-        <file-name-template>{project.name}-{project.version}/{date}-{host-name}-{build.name}-{build.id}.txt</file-name-template>
+        <build-task-queue>BUILD.TASKS</build-task-queue>
+        <max-requeue>5</max-requeue>
       </configuration>
     </component>
 

Modified: geronimo/gbuild/trunk/gbuild-agent-application/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent-application/pom.xml?rev=397693&r1=397692&r2=397693&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent-application/pom.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent-application/pom.xml Thu Apr 27 17:45:01 2006
@@ -99,6 +99,12 @@
         </dependency>
 
         <dependency>
+            <groupId>${pom.groupId}.extension</groupId>
+            <artifactId>requeue-failed</artifactId>
+            <version>${pom.version}</version>
+        </dependency>
+
+        <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>
         </dependency>

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java?rev=397693&r1=397692&r2=397693&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java
(original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java
Thu Apr 27 17:45:01 2006
@@ -28,6 +28,7 @@
 import javax.jms.ObjectMessage;
 import java.io.File;
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -112,8 +113,8 @@
     }
 
     private void processMessages(Client client) throws JMSException {
-//        MessageConsumer buildConsumer = client.createQueueConsumer(buildTaskQueue, "stan
is null");
-        MessageConsumer buildConsumer = client.createQueueConsumer(buildTaskQueue);
+
+        MessageConsumer buildConsumer = client.createQueueConsumer(buildTaskQueue, getHostName()
+ " is null");
         MessageProducer resultsProducer = client.createTopicProducer(buildResultsTopic);
         getLogger().debug("Processing messages.");
 
@@ -122,6 +123,15 @@
             if (message instanceof ObjectMessage) {
                 processMessage(message, client, resultsProducer);
             }
+        }
+    }
+
+    private String getHostName() {
+        try {
+            InetAddress localHost = InetAddress.getLocalHost();
+            return localHost.getHostName();
+        } catch (UnknownHostException e) {
+            throw new RuntimeException("Unable to get host name.", e);
         }
     }
 

Modified: geronimo/gbuild/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/pom.xml?rev=397693&r1=397692&r2=397693&view=diff
==============================================================================
--- geronimo/gbuild/trunk/pom.xml (original)
+++ geronimo/gbuild/trunk/pom.xml Thu Apr 27 17:45:01 2006
@@ -141,6 +141,7 @@
         <module>gbuild-agent</module>
         <module>gbuild-agent-web</module>
         <module>gbuild-report</module>
+        <module>extensions</module>
         <module>gbuild-agent-application</module>
     </modules>
 



Mime
View raw message