geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r348131 - in /geronimo/gbuild/trunk: gbuild-agent-application/src/conf/application.xml gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
Date Tue, 22 Nov 2005 08:42:01 GMT
Author: dblevins
Date: Tue Nov 22 00:41:53 2005
New Revision: 348131

URL: http://svn.apache.org/viewcvs?rev=348131&view=rev
Log:
Forgot to set the ping functionality to run by default.  Added ping monitor config in applications.xml

Modified:
    geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java

Modified: geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml?rev=348131&r1=348130&r2=348131&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml Tue Nov 22 00:41:53
2005
@@ -137,6 +137,18 @@
     </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>
+      <configuration>
+        <coordinator-url>tcp://ci.gbuild.org:16161</coordinator-url>
+      </configuration>
+    </component>
+
+    <!--
     | Logger manager
     -->
     <component>

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/AbstractContinuumBuildAgent.java?rev=348131&r1=348130&r2=348131&view=diff
==============================================================================
--- 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/AbstractContinuumBuildAgent.java
Tue Nov 22 00:41:53 2005
@@ -184,7 +184,7 @@
             this.listener = listener;
             this.session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
             this.logger = logger;
-            this.ping = new Ping(session);
+            this.ping = new Ping(session, logger);
             ping.start();
         }
 
@@ -232,7 +232,7 @@
 
             Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
 
-            Ping ping = new Ping(session);
+            Ping ping = new Ping(session, getLogger());
             ping.start();
 
             return new Client(this, connection, session, ping);
@@ -245,7 +245,7 @@
         }
 
         private Connection connect() throws JMSException {
-            return connect(5);
+            return connect(10);
         }
 
         private Connection connect(int tries) throws JMSException {
@@ -293,6 +293,19 @@
         private boolean run;
         private final Session session;
         private final MessageProducer producer;
+        private final Logger logger;
+
+        public Ping(Session session, Logger logger) throws JMSException {
+            this.session = session;
+            Topic topic = session.createTopic("BUILD.PING");
+            producer = session.createProducer(topic);
+            this.logger = logger;
+            run = true;
+        }
+
+        public Logger getLogger() {
+            return logger;
+        }
 
         public void start() {
             Thread thread = new Thread(this);
@@ -304,12 +317,6 @@
             setRun(false);
         }
 
-        public Ping(Session session) throws JMSException {
-            this.session = session;
-            Topic topic = session.createTopic("BUILD.PING");
-            producer = session.createProducer(topic);
-        }
-
         public synchronized boolean isRunning() {
             return run;
         }
@@ -323,7 +330,7 @@
                 try {
                     ping();
                 } catch (JMSException e) {
-                    e.printStackTrace();
+                    getLogger().warn("Ping thread killed ("+e.getMessage()+")");
                 }
                 try {
                     Thread.sleep(60000);
@@ -335,6 +342,7 @@
         private void ping() throws JMSException {
             TextMessage message = session.createTextMessage(Long.toString(System.currentTimeMillis()));
             producer.send(message);
+//            getLogger().debug("ping sent");
         }
     }
 }



Mime
View raw message