geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r464142 [1/4] - in /geronimo/gbuild/trunk: ./ gbuild-agent/ gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ gbuild-agent/src/main/java/org/apache/geronimo/gb...
Date Sun, 15 Oct 2006 07:06:32 GMT
Author: jdillon
Date: Sun Oct 15 00:06:27 2006
New Revision: 464142

URL: http://svn.apache.org/viewvc?view=rev&rev=464142
Log:
Moved tests to match their targets package & module
Updated headers in all tests
Moved all of the continuum specific bits to *.continuum
Moved activity components to *.activity
Moved ping bits to *.client, unrolled Ping class from Client, renamed to PingProducer
Removed ThreadContextContinuumStore, replaced by ThreadContextContinuumStoreFactory which uses a reflected proxy to delegate to a ContinuumStore bound to the current thread
Updated dependencies to use continuum 1.0.3
Added more javadocs for the classes which I have figured out what they do
Added asserts and finals to help ensure proper operation
Removed AbstractContinuumBuildAgent, added Context class to help get to the continuum context bits instead of using inheritance
Removed ExecuteDistributedBuilderContinuumAction && DistrubutedBuildController, the default components in 1.0.3 are more functional than these
Added crude ActiveMQ embedded broker component

Added:
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityMonitor.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityNotifier.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PingMonitorAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildResultsContinuumAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/ContinuumBuildAgent.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/LoggingContinuumNotificationDispatcher.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/MockContinuumNotificationDispatcher.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/MapContinuumStore.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/MapContinuumStore.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/MockContinuumStore.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/MockContinuumStore.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/ThreadContextContinuumStoreFactory.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/BuildAgentExtentionSupport.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/BuildResultsExtensionSupport.java   (with props)
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/producer/
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/producer/BuildQueueReloader.java   (contents, props changed)
      - copied, changed from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/producer/DirectoryMonitor.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/DirectoryMonitor.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/producer/PropertiesBuildTaskProducer.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PropertiesBuildTaskProducer.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/CVS.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/CVS.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/Chmod.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/Chmod.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/ContinuumBuildAgentTest.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgentTest.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/SVN.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/SVN.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/SystemExecutable.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/SystemExecutable.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/continuum/TestLogger.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/TestLogger.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/producer/
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/producer/DirectoryMonitorTest.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/DirectoryMonitorTest.java
    geronimo/gbuild/trunk/gbuild-assemblies/gbuild-agent-assembly/src/main/resources/activemq.xml   (with props)
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/agent/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/agent/extension/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/agent/extension/standard/
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/agent/extension/standard/KillProcessesExtensionTest.java   (with props)
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/agent/extension/standard/TestLogger.java   (with props)
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/test/java/org/apache/geronimo/gbuild/agent/extension/standard/WriteIncludeFileExtensionTest.java   (contents, props changed)
      - copied, changed from r463602, geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/WriteIncludeFileExtentionTest.java
Removed:
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumAgentAction.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityMonitor.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityNotifier.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildResultsContinuumAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/DirectoryMonitor.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/DistrubutedBuildController.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ExecuteDistributedBuilderContinuumAction.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/MapContinuumStore.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/MockContinuumNotificationDispatcher.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/MockContinuumStore.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PingMonitorAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PropertiesBuildTaskProducer.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ThreadContextContinuumStore.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/CVS.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/Chmod.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/ContinuumBuildAgentTest.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/DirectoryMonitorTest.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/KillProcessesExtensionTest.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/SVN.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/SystemExecutable.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/TestLogger.java
    geronimo/gbuild/trunk/gbuild-agent/src/test/java/org/apache/geronimo/gbuild/agent/WriteIncludeFileExtentionTest.java
Modified:
    geronimo/gbuild/trunk/gbuild-agent/pom.xml
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgent.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgentException.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/Client.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/ClientManager.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/BuildAgentExtension.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/BuildAgentExtentionManager.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/BuildResultsExtension.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/BuildResultsExtensionManager.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/DefaultBuildAgentExtensionManager.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/DefaultBuildResultsExtensionManager.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/extension/NoSuchExtentionException.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/util/GZipUtils.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/util/StringTemplate.java
    geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml
    geronimo/gbuild/trunk/gbuild-assemblies/gbuild-agent-assembly/pom.xml
    geronimo/gbuild/trunk/gbuild-assemblies/gbuild-agent-assembly/src/main/resources/application.xml
    geronimo/gbuild/trunk/gbuild-assemblies/gbuild-manager-assembly/src/main/resources/application.xml
    geronimo/gbuild/trunk/gbuild-extensions/requeue-failed/src/main/java/org/apache/geronimo/gbuild/extension/requeue/RequeueFailedBuilds.java
    geronimo/gbuild/trunk/gbuild-extensions/requeue-failed/src/main/resources/META-INF/plexus/components.xml
    geronimo/gbuild/trunk/gbuild-extensions/standard/pom.xml
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/BuildOutputExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/FileIncludeExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/HeaderIncludeExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/KillProcessesExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/LogFailedBuildsExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/ReportActivityExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/java/org/apache/geronimo/gbuild/agent/extension/standard/WriteIncludeFileExtension.java
    geronimo/gbuild/trunk/gbuild-extensions/standard/src/main/resources/META-INF/plexus/components.xml
    geronimo/gbuild/trunk/pom.xml

Modified: geronimo/gbuild/trunk/gbuild-agent/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/pom.xml?view=diff&rev=464142&r1=464141&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/pom.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent/pom.xml Sun Oct 15 00:06:27 2006
@@ -56,7 +56,8 @@
             <groupId>org.apache.maven.continuum</groupId>
             <artifactId>continuum-model</artifactId>
         </dependency>
-        
+
+        <!--
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-command-line</artifactId>
@@ -66,7 +67,9 @@
             <groupId>org.apache.maven.scm</groupId>
             <artifactId>maven-scm-provider-cvs</artifactId>
         </dependency>
-        
+        -->
+
+        <!--
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jms_1.1_spec</artifactId>
@@ -76,6 +79,7 @@
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
         </dependency>
+        -->
         
         <dependency>
             <groupId>org.codehaus.swizzle</groupId>

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgent.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgent.java?view=diff&rev=464142&r1=464141&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgent.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgent.java Sun Oct 15 00:06:27 2006
@@ -20,8 +20,12 @@
 package org.apache.geronimo.gbuild.agent;
 
 /**
+ * Defines the basic build agent role.
+ * 
  * @version $Rev$ $Date$
  */
-public interface BuildAgent extends Runnable {
+public interface BuildAgent
+    extends Runnable
+{
     String ROLE = BuildAgent.class.getName();
 }

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgentException.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgentException.java?view=diff&rev=464142&r1=464141&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgentException.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildAgentException.java Sun Oct 15 00:06:27 2006
@@ -20,12 +20,18 @@
 package org.apache.geronimo.gbuild.agent;
 
 /**
+ * Thrown to indicate a general problem with an agent.
+ * 
  * @version $Rev$ $Date$
  */
-public class BuildAgentException extends Exception {
-
-    public BuildAgentException(String s, Exception e) {
-        super(s, e);
+public class BuildAgentException
+    extends Exception
+{
+    public BuildAgentException(final String msg, final Throwable cause) {
+        super(msg, cause);
     }
 
+    public BuildAgentException(final String msg) {
+        super(msg);
+    }
 }

Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java?view=auto&rev=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java (added)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java Sun Oct 15 00:06:27 2006
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.agent.activemq;
+
+import org.apache.activemq.broker.BrokerService;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public interface ActiveMQBrokerService
+{
+    String ROLE = ActiveMQBrokerService.class.getName();
+    
+    BrokerService getBrokerService();
+}

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerService.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java?view=auto&rev=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java (added)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java Sun Oct 15 00:06:27 2006
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.agent.activemq;
+
+import java.net.InetAddress;
+import java.net.URI;
+import java.io.File;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
+
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.BrokerFactory;
+import org.apache.activemq.store.DefaultPersistenceAdapterFactory;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public class ActiveMQBrokerServiceImpl
+    extends AbstractLogEnabled
+    implements ActiveMQBrokerService, Initializable, Startable
+{
+    private Logger log;
+
+    private String brokerUri;
+
+    private String brokerName;
+
+    private String[] transportConnectors;
+
+    private String[] networkConnectors;
+
+    private File dataDirectory;
+
+    private BrokerService brokerService;
+
+    public BrokerService getBrokerService() {
+        return brokerService;
+    }
+
+    public void initialize() throws InitializationException {
+        log = getLogger();
+    }
+
+    public void start() throws StartingException {
+        if (brokerService != null) {
+            log.warn("Broker already started; ignoring duplicate start request");
+            return;
+        }
+
+        log.info("Starting...");
+
+        try {
+            BrokerService broker;
+
+            if (brokerUri != null) {
+                log.info("Configuring broker from URI: " + brokerUri);
+
+                //
+                // HACK: Set a system property to allow the datadir to resolve
+                //
+                System.setProperty("activemq.datadir", dataDirectory.getAbsolutePath());
+                
+                broker = BrokerFactory.createBroker(new URI(brokerUri));
+            }
+            else {
+                broker = new BrokerService();
+
+                if (brokerName == null) {
+                    brokerName = InetAddress.getLocalHost().getHostName();
+                }
+
+                log.info("Using broker name: " + brokerName);
+                broker.setBrokerName(brokerName);
+
+                broker.setUseShutdownHook(false);
+
+                broker.setUseJmx(false);
+
+                log.info("Using data directory: " + dataDirectory);
+                DefaultPersistenceAdapterFactory persistenceFactory = (DefaultPersistenceAdapterFactory)broker.getPersistenceFactory();
+                persistenceFactory.setDataDirectoryFile(dataDirectory);
+
+                if (transportConnectors != null) {
+                    for (int i = 0; i < transportConnectors.length; i++) {
+                        log.info("Adding transport connector: " + transportConnectors[i]);
+
+                        broker.addConnector(transportConnectors[i]);
+                    }
+                }
+
+                if (networkConnectors != null) {
+                    for (int i = 0; i < networkConnectors.length; i++) {
+                        log.info("Adding network connector: " + networkConnectors[i]);
+
+                        broker.addNetworkConnector(networkConnectors[i]);
+                    }
+                }
+            }
+
+            broker.start();
+            
+            brokerService = broker;
+        }
+        catch (Exception e) {
+            throw new StartingException("Failed to start ActiveMQ broker servive", e);
+        }
+
+        log.info("Started");
+    }
+
+    public void stop() throws StoppingException {
+        if (brokerService == null) {
+            log.warn("Broker not started; ignoring stop request");
+        }
+
+        log.info("Stopping...");
+
+        BrokerService broker = brokerService;
+        brokerService = null;
+
+        try {
+            broker.stop();
+        }
+        catch (Exception e) {
+            throw new StoppingException("Failed to stop ActiveMQ broker service", e);
+        }
+
+        log.info("Stopped");
+    }
+}

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activemq/ActiveMQBrokerServiceImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java (from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityMonitor.java)
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java?view=diff&rev=464142&p1=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityMonitor.java&r1=463604&p2=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityMonitor.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java Sun Oct 15 00:06:27 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gbuild.agent;
+package org.apache.geronimo.gbuild.agent.activity;
 
 import java.util.Map;
 import javax.jms.Connection;
@@ -27,40 +27,53 @@
 import javax.jms.ObjectMessage;
 import javax.jms.Session;
 
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
 
-import org.apache.geronimo.gbuild.agent.util.StringTemplate;
 import org.apache.geronimo.gbuild.agent.client.Client;
+import org.apache.geronimo.gbuild.agent.continuum.AbstractContinuumBuildAgent;
+import org.apache.geronimo.gbuild.agent.util.StringTemplate;
 
 /**
+ * ???
+ *
  * @version $Rev$ $Date$
  */
-public class BuildActivityMonitor extends AbstractContinuumBuildAgent {
+public class BuildActivityMonitor
+    extends AbstractContinuumBuildAgent
+    implements Initializable
+{
+    private Logger log;
 
-    /**
-     * @plexus.configuration
-     */
     private String buildActivityTopic;
 
-    /**
-     * @plexus.configuration
-     */
     private String logFormat;
+
     private StringTemplate template;
+    
+    public void initialize() throws InitializationException {
+        log = getLogger();
+    }
 
     public synchronized void start() throws StartingException {
         template = new StringTemplate(logFormat);
+        
         super.start();
     }
 
-    public void execute(Map context) throws Exception {
-        getLogger().info(template.apply(context));
+    public void execute(final Map context) throws Exception {
+        assert context != null;
+        
+        log.info(template.apply(context));
     }
 
     public void run() {
         try {
-            getLogger().info("Build Activity Agent.");
-            getLogger().debug("buildActivityTopic " + buildActivityTopic);
+            log.info("Running");
+
+            log.debug("buildActivityTopic: " + buildActivityTopic);
 
             while (isRunning()) {
                 // Create a Session
@@ -72,45 +85,43 @@
 
                 try {
                     consumeMessages(client, resultsConsumer);
-                } catch (JMSException e) {
-                    getLogger().error("Agent recieved JMS Exception. ("+e.getMessage()+")");
+                }
+                catch (JMSException e) {
+                    log.error("Agent recieved JMS Exception", e);
                 }
             }
-
-        } catch (Exception e) {
-            getLogger().error("Agent failed.", e);
+        }
+        catch (Exception e) {
+            log.error("Agent failed", e);
         }
     }
 
-    private void consumeMessages(Client client, MessageConsumer resultsConsumer) throws JMSException {
+    private void consumeMessages(final Client client, final MessageConsumer resultsConsumer) throws JMSException {
+        assert client != null;
+        assert resultsConsumer != null;
+
         while (client.isConnected() && isRunning()) {
-            // Wait for a message
             Message message = resultsConsumer.receive(1000);
 
-            if (message == null){
-
-                continue;
-
-            } else if (message instanceof ObjectMessage) {
-
-                try {
-                    Connection connection = client.getConnection();
-                    getLogger().debug("Message Received "+ message.getJMSMessageID() +" on "+ connection.getClientID()+":"+buildActivityTopic);
-
-                    ObjectMessage objectMessage = (ObjectMessage) message;
-
-                    Map context = getMap(objectMessage, message);
-
-                    execute(context);
-
-                    getLogger().debug("Finished processing "+ message.getJMSMessageID());
-
-                } catch (Exception e) {
-                    getLogger().error("Failed Processing message "+message.getJMSMessageID());
+            if (message != null) {
+                if (message instanceof ObjectMessage) {
+                    try {
+                        Connection connection = client.getConnection();
+                        log.debug("Message Received " + message.getJMSMessageID() + " on " + connection.getClientID() + ":" + buildActivityTopic);
+
+                        Map context = getMapFromMessage(message);
+
+                        execute(context);
+
+                        log.debug("Finished processing: " + message.getJMSMessageID());
+                    }
+                    catch (Exception e) {
+                        log.error("Failed Processing message: " + message.getJMSMessageID());
+                    }
+                }
+                else {
+                    log.warn("Agent received incorrect message type: " + message.getClass().getName());
                 }
-
-            } else {
-                getLogger().warn("Agent received incorrect message type: "+message.getClass().getName());
             }
         }
     }

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityMonitor.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java (from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityNotifier.java)
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java?view=diff&rev=464142&p1=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityNotifier.java&r1=463604&p2=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildActivityNotifier.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java Sun Oct 15 00:06:27 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gbuild.agent;
+package org.apache.geronimo.gbuild.agent.activity;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -28,47 +28,55 @@
 import javax.jms.ObjectMessage;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 
 import org.apache.geronimo.gbuild.agent.client.Client;
 import org.apache.geronimo.gbuild.agent.client.ClientManager;
+import org.apache.geronimo.gbuild.agent.continuum.Context;
+import org.apache.geronimo.gbuild.agent.continuum.ContinuumBuildAgent;
 
 /**
+ * ???
+ *
  * @version $Rev$ $Date$
  */
-public class BuildActivityNotifier extends AbstractLogEnabled {
+public class BuildActivityNotifier
+    extends AbstractLogEnabled
+    implements Initializable
+{
+    private Logger log;
 
-    /**
-     * @plexus.requirement
-     */
     private ClientManager clientManager;
 
-    /**
-     * @plexus.configuration
-     */
     private String buildActivityTopic;
 
-    
-    public void sendNotification(Map build, String notification) {
-        HashMap map = new HashMap();
-
-        map.putAll(build);
+    public void initialize() throws InitializationException {
+        log = getLogger();
+    }
 
-        ContinuumBuildAgent.setSystemProperty(map, ContinuumBuildAgent.KEY_OS_VERSION);
+    public void sendNotification(final Map build, final String notification) {
+        assert build != null;
+        assert notification != null;
 
-        ContinuumBuildAgent.setSystemProperty(map, ContinuumBuildAgent.KEY_OS_NAME);
+        HashMap map = new HashMap();
 
-        ContinuumBuildAgent.setSystemProperty(map, ContinuumBuildAgent.KEY_JAVA_VERSION);
+        map.putAll(build);
 
-        ContinuumBuildAgent.setSystemProperty(map, ContinuumBuildAgent.KEY_JAVA_VENDOR);
+        ContinuumBuildAgent.setSystemProperty(map, Context.KEY_OS_VERSION);
+        ContinuumBuildAgent.setSystemProperty(map, Context.KEY_OS_NAME);
+        ContinuumBuildAgent.setSystemProperty(map, Context.KEY_JAVA_VERSION);
+        ContinuumBuildAgent.setSystemProperty(map, Context.KEY_JAVA_VENDOR);
 
         try {
             InetAddress localHost = InetAddress.getLocalHost();
 
-            map.put(ContinuumBuildAgent.KEY_HOST_NAME, localHost.getHostName());
-
-            map.put(ContinuumBuildAgent.KEY_HOST_ADDRESS, localHost.getHostAddress());
-        } catch (UnknownHostException e) {
-            getLogger().warn("Unable to determine local host information", e);
+            map.put(Context.KEY_HOST_NAME, localHost.getHostName());
+            map.put(Context.KEY_HOST_ADDRESS, localHost.getHostAddress());
+        }
+        catch (UnknownHostException e) {
+            log.warn("Unable to determine local host information", e);
         }
 
         map.put("notification", notification);
@@ -77,13 +85,12 @@
             Client client = clientManager.getClient();
 
             ObjectMessage message = client.getSession().createObjectMessage(map);
-
             MessageProducer producer = client.createTopicProducer(buildActivityTopic);
 
             producer.send(message);
-        } catch (JMSException e1) {
-            getLogger().error("Send failed.", e1);
+        }
+        catch (JMSException e) {
+            log.error("Send failed.", e);
         }
     }
-
 }

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/activity/BuildActivityNotifier.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/Client.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/Client.java?view=diff&rev=464142&r1=464141&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/Client.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/Client.java Sun Oct 15 00:06:27 2006
@@ -27,7 +27,6 @@
 import javax.jms.MessageProducer;
 import javax.jms.Queue;
 import javax.jms.Session;
-import javax.jms.TextMessage;
 import javax.jms.Topic;
 
 import org.codehaus.plexus.logging.Logger;
@@ -36,21 +35,36 @@
 import org.apache.activemq.ActiveMQPrefetchPolicy;
 
 /**
+ * Provides access to the messaging system used to facilitate agent communication.
+ *
  * @version $Rev$ $Date$
  */
-public class Client implements ExceptionListener {
-
+public class Client
+    implements ExceptionListener
+{
+    private final Logger logger;
+    
     private final String brokerUrl;
+
     private final Connection connection;
+
     private final Session session;
+
     private final ExceptionListener listener;
-    private final Logger logger;
+
     private boolean connected = true;
-    private final Ping ping;
+
+    private final PingProducer ping;
+
     private final int delay;
+
     private final int maxTries;
 
-    private Client(Client old, Connection connection, Session session) throws JMSException {
+    private Client(final Client old, final Connection connection, final Session session) throws JMSException {
+        assert old != null;
+        assert connection != null;
+        assert session != null;
+
         this.brokerUrl = old.brokerUrl;
         this.delay = old.delay;
         this.maxTries = old.maxTries;
@@ -59,11 +73,22 @@
         this.connection = connection;
         this.session = session;
 
-        this.ping = new Ping(session, getLogger(), old.ping.getInterval());
+        this.ping = new PingProducer(session, getLogger(), old.ping.getInterval());
         ping.start();
-     }
+    }
+
+    public Client(final String brokerUrl,
+                  final ExceptionListener listener,
+                  final Logger logger,
+                  final int reconnectDelay,
+                  final int reconnectTries,
+                  final int pingInterval)
+        throws JMSException
+    {
+        assert brokerUrl != null;
+        assert listener != null;
+        assert logger != null;
 
-    public Client(String brokerUrl, ExceptionListener listener, Logger logger, int reconnectDelay, int reconnectTries, int pingInterval) throws JMSException {
         this.brokerUrl = brokerUrl;
         connection = createConnection(brokerUrl);
         connection.setExceptionListener(this);
@@ -73,7 +98,8 @@
         this.logger = logger;
         this.delay = reconnectDelay;
         this.maxTries = reconnectTries;
-        this.ping = new Ping(session, logger, pingInterval);
+
+        this.ping = new PingProducer(session, logger, pingInterval);
         ping.start();
     }
 
@@ -97,25 +123,38 @@
         return session;
     }
 
-    public MessageConsumer createQueueConsumer(String subject) throws JMSException {
+    public MessageConsumer createQueueConsumer(final String subject) throws JMSException {
+        assert subject != null;
+
         Queue queue = session.createQueue(subject);
+
         return session.createConsumer(queue);
     }
 
-    public MessageConsumer createQueueConsumer(String subject, String selector) throws JMSException {
+    public MessageConsumer createQueueConsumer(final String subject, final String selector) throws JMSException {
+        assert subject != null;
+        assert selector != null;
+
         Queue queue = session.createQueue(subject);
+
         return session.createConsumer(queue, selector);
     }
 
-    public MessageConsumer createTopicConsumer(String subject) throws JMSException {
+    public MessageConsumer createTopicConsumer(final String subject) throws JMSException {
+        assert subject != null;
+
         Topic topic = session.createTopic(subject);
+
         return session.createConsumer(topic);
     }
 
-    public MessageProducer createTopicProducer(String subject) throws JMSException {
+    public MessageProducer createTopicProducer(final String subject) throws JMSException {
+        assert subject != null;
+
         Topic topic = session.createTopic(subject);
         MessageProducer producer = session.createProducer(topic);
         producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+
         return producer;
     }
 
@@ -140,111 +179,60 @@
     }
 
     private Connection connect(int tries) throws JMSException {
-
         try {
             Connection connection = createConnection(brokerUrl);
             connection.setExceptionListener(this);
             connection.start();
             getLogger().info("Client reconnect successful.");
+
             return connection;
-        } catch (JMSException e) {
+        }
+        catch (JMSException e) {
             if (tries <= 0) {
                 getLogger().info("Client reconnect failed.  Giving up.", e);
                 throw e;
-            } else {
+            }
+            else {
                 try {
                     getLogger().info("Client reconnect failed.  Trying again in "+delay+" milliseconds. ("+ e.getMessage()+")");
                     Thread.sleep(delay);
-                } catch (InterruptedException dontCare) {
                 }
+                catch (InterruptedException ignore) {
+                    // empty
+                }
+
                 return connect(--tries);
             }
         }
     }
 
-    private Connection createConnection(String brokerUrl) throws JMSException {
+    private Connection createConnection(final String brokerUrl) throws JMSException {
+        assert brokerUrl != null;
+
         ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUrl);
         ActiveMQPrefetchPolicy prefetchPolicy = connectionFactory.getPrefetchPolicy();
         prefetchPolicy.setQueuePrefetch(1);
+
         return connectionFactory.createConnection();
     }
 
     /**
      * Marks this client as failed and returns its previous state
+     *
      * @return false if the client was not previously in a failed state
      */
     private synchronized boolean failed() {
         boolean failed = !connected;
         connected = false;
+        
         return failed;
     }
 
-    public void onException(JMSException jmsException) {
-        getLogger().info("JMSException "+this.hashCode());
-        this.listener.onException(jmsException);
-    }
-
-    public static class Ping implements Runnable {
-        private boolean run;
-        private final Session session;
-        private final MessageProducer producer;
-        private final Logger logger;
-        private final int interval;
-
-        public Ping(Session session, Logger logger, int interval) throws JMSException {
-            this.logger = logger;
-            this.run = true;
-            this.interval = interval;
-
-            this.session = session;
-            Topic topic = session.createTopic("BUILD.PING");
-            this.producer = session.createProducer(topic);
-        }
+    public void onException(final JMSException cause) {
+        assert cause != null;
 
-        public int getInterval() {
-            return interval;
-        }
+        getLogger().warn("Unexpected JMS exception", cause);
 
-        public Logger getLogger() {
-            return logger;
-        }
-
-        public void start() {
-            Thread thread = new Thread(this);
-            thread.setDaemon(true);
-            thread.start();
-        }
-
-        public void stop(){
-            setRun(false);
-        }
-
-        public synchronized boolean isRunning() {
-            return run;
-        }
-
-        public synchronized void setRun(boolean run) {
-            this.run = run;
-        }
-
-        public void run() {
-            while (isRunning()){
-                try {
-                    ping();
-                } catch (JMSException e) {
-                    getLogger().warn("Ping thread killed ("+e.getMessage()+")");
-                }
-                try {
-                    Thread.sleep(interval);
-                } catch (InterruptedException e) {
-                }
-            }
-        }
-
-        private void ping() throws JMSException {
-            TextMessage message = session.createTextMessage(Long.toString(System.currentTimeMillis()));
-            producer.send(message);
-        }
+        this.listener.onException(cause);
     }
-
 }

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/ClientManager.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/ClientManager.java?view=diff&rev=464142&r1=464141&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/ClientManager.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/ClientManager.java Sun Oct 15 00:06:27 2006
@@ -25,16 +25,27 @@
 import javax.jms.JMSException;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Startable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
 
-import org.apache.geronimo.gbuild.agent.client.Client;
+import org.apache.geronimo.gbuild.agent.activemq.ActiveMQBrokerService;
 
 /**
+ * Manages the {@link Client} instance.
+ *
  * @version $Rev$ $Date$
  */
-public class ClientManager extends AbstractLogEnabled implements ExceptionListener, Startable {
+public class ClientManager
+    extends AbstractLogEnabled
+    implements ExceptionListener, Initializable, Startable
+{
+    private Logger log;
+    
+    private ActiveMQBrokerService brokerService;
 
     /**
      * @plexus.configuration
@@ -87,8 +98,9 @@
         timeUnits.put("d", new Integer(unit));
     }
 
-    public ClientManager(String brokerUrl, int pingInterval, int reconnectAttempts, int reconnectDelay) {
+    public ClientManager(final String brokerUrl, final int pingInterval, final int reconnectAttempts, final int reconnectDelay) {
         this();
+
         this.brokerUrl = brokerUrl;
         this.pingInterval = pingInterval;
         this.reconnectAttempts = reconnectAttempts;
@@ -99,47 +111,74 @@
         return brokerUrl;
     }
 
+    private synchronized void reconnect() throws JMSException {
+        this.client = client.reconnect();
+    }
+
+    public synchronized Client getClient() {
+        return client;
+    }
+
+    private synchronized void setClient(final Client client) {
+        assert client != null;
+        
+        this.client = client;
+    }
+
+    //
+    // Startable
+    //
+
     public synchronized void start() throws StartingException {
+        log.info("Starting...");
+
         Integer unit = (Integer) timeUnits.get(reconnectDelayUnit);
+
         if (unit == null){
-            unit = new Integer(1000); //seconds
+            unit = new Integer(1000); // seconds
         }
+
         try {
             setClient(new Client(brokerUrl, this, getLogger(), reconnectDelay * unit.intValue(), reconnectAttempts, pingInterval));
-        } catch (Throwable e) {
-            getLogger().error("Could not create connection to: " + brokerUrl, e);
+        }
+        catch (Throwable e) {
+            log.error("Could not create connection to: " + brokerUrl, e);
             throw new StartingException("Could not create connection to: " + brokerUrl);
         }
-        getLogger().info("Client connected: " + brokerUrl);
+
+        log.info("Started");
     }
 
     public synchronized void stop() throws StoppingException {
+        log.info("Stopping...");
+
         try {
             getClient().close();
-        } catch (JMSException e) {
-            getLogger().error("Could not close connection to: " + brokerUrl, e);
+        }
+        catch (JMSException e) {
+            log.error("Could not close connection to: " + brokerUrl, e);
             throw new StoppingException("Could not close connection to: " + brokerUrl);
         }
+
+        log.info("Stopped");
     }
 
     public void onException(JMSException ex) {
-        getLogger().fatalError("JMS Exception occured.  Attempting reconnect.", ex);
+        log.fatalError("JMS Exception occured.  Attempting reconnect.", ex);
+
         try {
             reconnect();
-        } catch (JMSException e) {
-            getLogger().error("Reconnect failed.", e);
+        }
+        catch (JMSException e) {
+            log.error("Reconnect failed.", e);
         }
     }
 
-    private synchronized void reconnect() throws JMSException {
-        this.client = client.reconnect();
-    }
-
-    public synchronized Client getClient() {
-        return client;
-    }
+    //
+    // Initializable
+    //
 
-    private synchronized void setClient(Client client) {
-        this.client = client;
+    public void initialize() throws InitializationException {
+        log = getLogger();
     }
 }

Copied: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java (from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PingMonitorAgent.java)
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java?view=diff&rev=464142&p1=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PingMonitorAgent.java&r1=463604&p2=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/PingMonitorAgent.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java Sun Oct 15 00:06:27 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gbuild.agent;
+package org.apache.geronimo.gbuild.agent.client;
 
 import java.util.Map;
 import javax.jms.JMSException;
@@ -26,49 +26,64 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import org.apache.geronimo.gbuild.agent.client.Client;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
+
+import org.apache.geronimo.gbuild.agent.continuum.AbstractContinuumBuildAgent;
 
 /**
+ * Consumes ping messages.
+ *
  * @version $Rev$ $Date$
  */
-public class PingMonitorAgent extends AbstractContinuumBuildAgent {
+public class PingMonitorAgent
+    extends AbstractContinuumBuildAgent
+    implements Initializable
+{
+    private Logger log;
 
     private String subject = "BUILD.PING";
 
-    public void execute(Map context) throws Exception {
+    public void initialize() throws InitializationException {
+        log = getLogger();
+    }
+
+    public void execute(final Map context) throws Exception {
+        // empty
     }
 
     public void run() {
         try {
-            getLogger().info("Ping Agent starting.");
+            log.info("Running...");
 
             while (isRunning()){
                 Client client = getClient();
-
                 Session session = client.getSession();
-
                 MessageConsumer consumer = createConsumer(session, subject);
 
                 try {
                     while (client.isConnected() && isRunning()) {
                         Message message = consumer.receive(1000);
 
-                        if (message == null){
-                            continue;
-                        } else if (message instanceof TextMessage) {
-                            TextMessage textMessage = (TextMessage) message;
-                            getLogger().debug("Ping "+ message.getJMSMessageID() +" : "+ textMessage.getText());
-                        } else {
-                            getLogger().warn("Agent received incorrect message type: "+message.getClass().getName());
+                        if (message != null) {
+                            if (message instanceof TextMessage) {
+                                TextMessage textMessage = (TextMessage) message;
+                                log.debug("Ping "+ message.getJMSMessageID() +" : "+ textMessage.getText());
+                            }
+                            else {
+                                log.error("Agent received incorrect message type: " + message.getClass().getName());
+                            }
                         }
                     }
-                } catch (JMSException e) {
-                    getLogger().info("Burp. "+e.getMessage());
+                }
+                catch (JMSException e) {
+                    log.error("Unhandled JMS failure", e);
                 }
             }
-        } catch (Exception e) {
-            getLogger().error("Agent failed.", e);
         }
-
+        catch (Exception e) {
+            log.error("Agent failed.", e);
+        }
     }
 }

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingMonitorAgent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java?view=auto&rev=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java (added)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java Sun Oct 15 00:06:27 2006
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.agent.client;
+
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+
+import org.codehaus.plexus.logging.Logger;
+
+/**
+ * Produces ping messages.
+ *
+ * @version $Rev$ $Date$
+ */
+public class PingProducer
+    implements Runnable
+{
+    private final Logger log;
+
+    private boolean run;
+
+    private final Session session;
+
+    private final MessageProducer producer;
+
+    private final int interval;
+
+    public PingProducer(final Session session, final Logger logger, final int interval) throws JMSException {
+        assert session != null;
+        assert logger != null;
+
+        this.log = logger;
+        this.run = true;
+        this.interval = interval;
+
+        log.info("Sending pings every " + interval + "ms");
+
+        this.session = session;
+        Topic topic = session.createTopic("BUILD.PING");
+        this.producer = session.createProducer(topic);
+    }
+
+    public int getInterval() {
+        return interval;
+    }
+
+    public void start() {
+        Thread thread = new Thread(this);
+        thread.setDaemon(true);
+        thread.start();
+    }
+
+    public void stop(){
+        setRun(false);
+    }
+
+    public synchronized boolean isRunning() {
+        return run;
+    }
+
+    public synchronized void setRun(final boolean run) {
+        this.run = run;
+    }
+
+    public void run() {
+        while (isRunning()){
+            try {
+                ping();
+            }
+            catch (JMSException e) {
+                log.warn("Ping thread killed (" + e.getMessage() + ")");
+            }
+
+            try {
+                Thread.sleep(interval);
+            }
+            catch (InterruptedException ignore) {
+                // empty
+            }
+        }
+    }
+
+    private void ping() throws JMSException {
+        log.info("Sending PING");
+
+        TextMessage message = session.createTextMessage(Long.toString(System.currentTimeMillis()));
+        producer.send(message);
+    }
+}
\ No newline at end of file

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/client/PingProducer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java (from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java)
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java?view=diff&rev=464142&p1=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java&r1=463604&p2=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java Sun Oct 15 00:06:27 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gbuild.agent;
+package org.apache.geronimo.gbuild.agent.continuum;
 
 import java.util.Map;
 import javax.jms.DeliveryMode;
@@ -34,15 +34,22 @@
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StartingException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.StoppingException;
 
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+
+import org.apache.geronimo.gbuild.agent.BuildAgent;
 import org.apache.geronimo.gbuild.agent.client.Client;
 import org.apache.geronimo.gbuild.agent.client.ClientManager;
 
 /**
+ * ???
+ *
  * @version $Rev$ $Date$
  */
-public abstract class AbstractContinuumBuildAgent extends AbstractContinuumAgentAction implements BuildAgent, Startable {
-
-    private boolean run;
+public abstract class AbstractContinuumBuildAgent
+    extends AbstractContinuumAction
+    implements BuildAgent, Startable
+{
+    private boolean running;
 
     /**
      * @plexus.requirement
@@ -50,27 +57,47 @@
     private ClientManager clientManager;
 
     public synchronized void start() throws StartingException {
-        run = true;
+        getLogger().info("Starting... ");
+
+        running = true;
         Thread agentThread = new Thread(this);
         agentThread.setDaemon(false);
         agentThread.start();
+
+        getLogger().info("Started");
     }
 
     public synchronized void stop() throws StoppingException {
-        run = false;
+        getLogger().info("Stopping...");
+        
+        running = false;
     }
 
     public synchronized boolean isRunning() {
-        return run;
+        return running;
     }
 
-    protected static MessageConsumer createQueueConsumer(Session session, String subject) throws JMSException {
+    //
+    // Connectivity helpers
+    //
+
+    public synchronized Client getClient() {
+        return clientManager.getClient();
+    }
+    
+    protected static MessageConsumer createQueueConsumer(final Session session, final String subject) throws JMSException {
+        assert session != null;
+        assert subject != null;
+
         Queue queue = session.createQueue(subject);
 
         return session.createConsumer(queue);
     }
 
-    protected static MessageProducer createTopicProducer(Session session, String subject) throws JMSException {
+    protected static MessageProducer createTopicProducer(final Session session, final String subject) throws JMSException {
+        assert session != null;
+        assert subject != null;
+
         Topic topic = session.createTopic(subject);
 
         MessageProducer producer = session.createProducer(topic);
@@ -80,25 +107,23 @@
         return producer;
     }
 
-    protected static MessageConsumer createConsumer(Session session, String subject) throws JMSException {
+    protected static MessageConsumer createConsumer(final Session session, final String subject) throws JMSException {
+        assert session != null;
+        assert subject != null;
+
         Topic topic = session.createTopic(subject);
-        return session.createConsumer(topic);
-    }
 
-    public static Map getMap(ObjectMessage objectMessage, Message message) throws JMSException, BuildAgentException {
-        try {
-            return (Map) objectMessage.getObject();
-        } catch (Exception e) {
-            throw new BuildAgentException("Message.getObject failed on "+ message.getJMSMessageID(), e);
-        }
+        return session.createConsumer(topic);
     }
 
-    public synchronized void setRun(boolean run) {
-        this.run = run;
-    }
+    public static Map getMapFromMessage(final Message message) throws JMSException {
+        assert message != null;
 
-    public synchronized Client getClient() {
-        return clientManager.getClient();
+        if (message instanceof ObjectMessage) {
+            return (Map) ((ObjectMessage)message).getObject();
+        }
+        else {
+            throw new IllegalArgumentException("Message was not an object container; found: " + message.getClass().getName());
+        }
     }
-
 }

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/AbstractContinuumBuildAgent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java (from r463604, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildResultsContinuumAgent.java)
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java?view=diff&rev=464142&p1=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildResultsContinuumAgent.java&r1=463604&p2=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java&r2=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildResultsContinuumAgent.java (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java Sun Oct 15 00:06:27 2006
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.gbuild.agent;
+package org.apache.geronimo.gbuild.agent.continuum;
 
 import java.util.Map;
 import javax.jms.Connection;
@@ -27,14 +27,21 @@
 import javax.jms.ObjectMessage;
 import javax.jms.Session;
 
-import org.apache.geronimo.gbuild.agent.extension.BuildResultsExtensionManager;
 import org.apache.geronimo.gbuild.agent.client.Client;
+import org.apache.geronimo.gbuild.agent.extension.BuildResultsExtensionManager;
 
 /**
+ * Component reponsible for handling build results.
+ *
+ * <p>
+ * Custom processing is handled by one or more {@link org.apache.geronimo.gbuild.agent.extension.BuildResultsExtension} instances.
+ * </p>
+ *
  * @version $Rev$ $Date$
  */
-public class BuildResultsContinuumAgent extends AbstractContinuumBuildAgent {
-
+public class BuildResultsContinuumAgent
+    extends AbstractContinuumBuildAgent
+{
     /**
      * @plexus.requirement
      */
@@ -44,8 +51,7 @@
      * @plexus.configuration
      */
     private String buildResultsTopic;
-
-
+    
     public void run() {
         try {
             getLogger().info("Results Agent starting.");
@@ -61,52 +67,52 @@
 
                 try {
                     consumeMessages(client, resultsConsumer);
-                } catch (JMSException e) {
-                    getLogger().error("Agent recieved JMS Exception. ("+e.getMessage()+")");
+                }
+                catch (JMSException e) {
+                    getLogger().error("Agent recieved JMS Exception. (" + e.getMessage() + ")");
                 }
             }
-
-        } catch (Exception e) {
+        }
+        catch (Exception e) {
             getLogger().error("Agent failed.", e);
         }
     }
 
-    private void consumeMessages(Client client, MessageConsumer resultsConsumer) throws JMSException {
+    private void consumeMessages(final Client client, final MessageConsumer resultsConsumer) throws JMSException {
+        assert client != null;
+        assert resultsConsumer != null;
+
         while (client.isConnected() && isRunning()) {
             // Wait for a message
             Message message = resultsConsumer.receive(1000);
 
             if (message == null){
-
                 continue;
-
-            } else if (message instanceof ObjectMessage) {
-
+            }
+            else if (message instanceof ObjectMessage) {
                 try {
                     Connection connection = client.getConnection();
-                    getLogger().info("Message Received "+ message.getJMSMessageID() +" on "+ connection.getClientID()+":"+buildResultsTopic);
-
-                    ObjectMessage objectMessage = (ObjectMessage) message;
+                    getLogger().info("Message Received: "+ message.getJMSMessageID() + " on " + connection.getClientID() + ":" + buildResultsTopic);
 
-                    Map context = getMap(objectMessage, message);
+                    Map context = getMapFromMessage(message);
 
                     execute(context);
 
-                    getLogger().info("Finished processing "+ message.getJMSMessageID());
-
-                } catch (Exception e) {
-                    getLogger().error("Failed Processing message "+message.getJMSMessageID());
+                    getLogger().info("Finished processing: " + message.getJMSMessageID());
                 }
-
-            } else {
-                getLogger().warn("Agent received incorrect message type: "+message.getClass().getName());
+                catch (Exception e) {
+                    getLogger().error("Failed Processing message: " + message.getJMSMessageID());
+                }
+            }
+            else {
+                getLogger().warn("Agent received incorrect message type: " + message.getClass().getName());
             }
         }
     }
 
-    public void execute(Map map) throws Exception {
+    public void execute(final Map map) throws Exception {
+        assert map != null;
+
         extentionManager.execute(map);
     }
-
-
 }

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/BuildResultsContinuumAgent.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java
URL: http://svn.apache.org/viewvc/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java?view=auto&rev=464142
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java (added)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java Sun Oct 15 00:06:27 2006
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.agent.continuum;
+
+import java.util.Map;
+
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.store.ContinuumStore;
+
+/**
+ * ???
+ *
+ * @version $Rev$ $Date$
+ */
+public abstract class Context
+    extends AbstractContinuumAction
+{
+    public static final String KEY_STORE = "store";
+
+    public static final String KEY_HOST_NAME = "host-name";
+
+    public static final String KEY_HOST_ADDRESS = "host-address";
+
+    public static final String KEY_CONTRIBUTOR = "contributor";
+
+    public static final String KEY_ADMIN_ADDRESS = "admin-address";
+
+    public static final String KEY_OS_VERSION = "os.version";
+
+    public static final String KEY_OS_NAME = "os.name";
+
+    public static final String KEY_JAVA_VERSION = "java.version";
+
+    public static final String KEY_JAVA_VENDOR = "java.vendor";
+
+    public static ContinuumStore getContinuumStore(final Map context) {
+        assert context != null;
+
+        return (ContinuumStore) getObject(context, KEY_STORE);
+    }
+}

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/continuum/Context.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message