geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r367548 - in /geronimo/gbuild/trunk: ./ gbuild-agent-application/ gbuild-agent-application/src/conf/ gbuild-agent/ gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ gbuild-agent/src/main/resources/META-INF/plexus/
Date Tue, 10 Jan 2006 10:07:23 GMT
Author: dblevins
Date: Tue Jan 10 02:07:19 2006
New Revision: 367548

URL: http://svn.apache.org/viewcvs?rev=367548&view=rev
Log:
Added in the web component.  Also new component to watch the queue and add more stuff when
it's empty.

Added:
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java
Modified:
    geronimo/gbuild/trunk/gbuild-agent-application/pom.xml
    geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml
    geronimo/gbuild/trunk/gbuild-agent/pom.xml
    geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml
    geronimo/gbuild/trunk/pom.xml

Modified: geronimo/gbuild/trunk/gbuild-agent-application/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent-application/pom.xml?rev=367548&r1=367547&r2=367548&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent-application/pom.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent-application/pom.xml Tue Jan 10 02:07:19 2006
@@ -89,6 +89,11 @@
       <version>1.0-SNAPSHOT</version>
     </dependency>
     <dependency>
+      <groupId>org.apache.geronimo.gbuild</groupId>
+      <artifactId>gbuild-agent-web</artifactId>
+      <version>1.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <version>1.2.8</version>

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=367548&r1=367547&r2=367548&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent-application/src/conf/application.xml Tue Jan 10 02:07:19
2006
@@ -22,6 +22,10 @@
       <role>org.apache.geronimo.gbuild.agent.BuildAgent</role>
       <role-hint>build-activity</role-hint>
     </component>
+    <component>
+      <role>org.apache.geronimo.gbuild.agent.BuildQueueReloader</role>
+      <role-hint>build-producer</role-hint>
+    </component>
     -->
   </load-on-start>
 
@@ -29,6 +33,33 @@
     <jar-repository>${plexus.home}/lib</jar-repository>
   </resources>
 
+  <services>
+    <service>
+      <id>jetty</id>
+      <configuration>
+        <webapps>
+          <webapp>
+            <file>${plexus.home}/lib/gbuild-agent-web-1.0-SNAPSHOT.jar</file>
+            <context>/gbuild</context>
+            <extraction-path>${plexus.home}/webapp</extraction-path>
+            <listeners>
+              <http-listener>
+                <port>17171</port>
+              </http-listener>
+              <!--
+              <proxy-http-listener>
+                <port>8090</port>
+                <proxy-host>localhost</proxy-host>
+                <proxy-port>80</proxy-port>
+              </proxy-http-listener>
+              -->
+            </listeners>
+          </webapp>
+        </webapps>
+      </configuration>
+    </service>
+  </services>
+
   <components>
     <component>
       <role>org.apache.geronimo.gbuild.agent.ClientManager</role>
@@ -77,7 +108,6 @@
 
     <component>
       <role>org.apache.maven.continuum.notification.ContinuumNotificationDispatcher</role>
-      <!--<role-hint>agent-notifier</role-hint>-->
       <implementation>org.apache.geronimo.gbuild.agent.MockContinuumNotificationDispatcher</implementation>
     </component>
 
@@ -242,43 +272,6 @@
             <hierarchy>org.activemq</hierarchy>
             <level>WARN</level>
           </level>
-
-            <!--There was no such logger 'org.apache.maven.continuum.configuration.ConfigurationService'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.execution.maven.m2.MavenBuilderHelper'
8918836.-->
-            <!--There was no such logger 'org.apache.geronimo.gbuild.agent.BuildResultsExtensionManager'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.execution.ContinuumBuildExecutor:shell'
8918836.-->
-            <!--There was no such logger 'org.codehaus.plexus.action.Action:checkout-project'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.buildcontroller.BuildController'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.scm.ContinuumScm'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.settings.MavenSettingsBuilder'
8918836.-->
-            <!--There was no such logger 'org.apache.geronimo.gbuild.agent.BuildResultsExtension:write-include-file'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.utils.WorkingDirectoryService'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.artifact.resolver.ArtifactResolver'
8918836.-->
-            <!--There was no such logger 'org.apache.geronimo.gbuild.agent.BuildAgentExtentionManager'
8918836.-->
-            <!--There was no such logger 'org.apache.geronimo.gbuild.agent.BuildAgent:build-producer'
8918836.-->
-            <!--There was no such logger 'org.codehaus.plexus.action.ActionManager' 8918836.-->
-            <!--There was no such logger 'org.apache.geronimo.gbuild.agent.BuildAgent:build-results'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.execution.ContinuumBuildExecutor:maven2'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.project.interpolation.ModelInterpolator'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.execution.manager.BuildExecutorManager'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.utils.shell.ShellCommandHelper'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.execution.ContinuumBuildExecutor:maven-1'
8918836.-->
-            <!--There was no such logger 'org.apache.geronimo.gbuild.agent.BuildAgentExtension:file-include'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.continuum.execution.maven.m1.MavenOneMetadataHelper'
8918836.-->
-            <!--There was no such logger 'org.codehaus.plexus.action.Action:execute-builder'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.artifact.repository.metadata.RepositoryMetadataManager'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.artifact.transform.ArtifactTransformation:release'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.project.MavenProjectBuilder'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.artifact.transform.ArtifactTransformation:snapshot'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.scm.manager.ScmManager' 8918836.-->
-            <!--There was no such logger 'org.apache.maven.artifact.manager.WagonManager'
8918836.-->
-            <!--There was no such logger 'org.codehaus.plexus.action.Action:update-project-from-working-directory'
8918836.-->
-            <!--There was no such logger 'org.codehaus.plexus.action.Action:check-working-directory'
8918836.-->
-            <!--There was no such logger 'org.apache.maven.artifact.transform.ArtifactTransformation:latest'
8918836.-->
-          <!--<level>-->
-            <!--<hierarchy>org.codehaus.plexus.velocity</hierarchy>-->
-            <!--<level>WARN</level>-->
-          <!--</level>-->
         </levels>
       </configuration>
     </component>

Modified: geronimo/gbuild/trunk/gbuild-agent/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/pom.xml?rev=367548&r1=367547&r2=367548&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/pom.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent/pom.xml Tue Jan 10 02:07:19 2006
@@ -87,8 +87,13 @@
     </dependency>
     <dependency>
       <groupId>geronimo-spec</groupId>
-      <artifactId>geronimo-spec-j2ee</artifactId>
-      <version>1.4-rc4</version>
+      <artifactId>geronimo-spec-jms</artifactId>
+      <version>1.1-rc4</version>
+    </dependency>
+    <dependency>
+      <groupId>geronimo-spec</groupId>
+      <artifactId>geronimo-spec-j2ee-management</artifactId>
+      <version>1.0-rc4</version>
     </dependency>
     <dependency>
       <groupId>activemq</groupId>

Added: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java?rev=367548&view=auto
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java
(added)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/BuildQueueReloader.java
Tue Jan 10 02:07:19 2006
@@ -0,0 +1,121 @@
+/**
+ *
+ * Copyright 2004 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.agent;
+
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+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 javax.jms.Session;
+import javax.jms.Queue;
+import javax.jms.QueueBrowser;
+import javax.jms.JMSException;
+import java.util.Enumeration;
+import java.io.File;
+import java.io.FilenameFilter;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class BuildQueueReloader extends AbstractLogEnabled implements Startable, Runnable
{
+
+    /**
+     * @plexus.requirement
+     */
+    private ClientManager clientManager;
+
+    /**
+     * @plexus.configuration
+     */
+    private String buildTaskQueue;
+
+    /**
+     * @plexus.configuration
+     */
+    private String tasksDirectory;
+
+    /**
+     * @plexus.configuration
+     */
+    private int pollInterval;
+
+
+    private boolean running;
+
+    public synchronized boolean isRunning() {
+        return running;
+    }
+
+    public synchronized void setRunning(boolean running) {
+        this.running = running;
+    }
+
+    public void start() throws StartingException {
+        setRunning(true);
+        Thread thread = new Thread(this);
+        thread.setDaemon(true);
+        thread.start();
+    }
+
+    public void stop() throws StoppingException {
+        setRunning(false);
+    }
+
+    public void run() {
+        while (isRunning()) {
+            checkTasksQueue();
+            try {
+                Thread.sleep(pollInterval*60000);
+            } catch (InterruptedException dontCare) {}
+        }
+    }
+
+    private void checkTasksQueue() {
+        if (isEmpty()){
+            getLogger().info(buildTaskQueue+" empty");
+            long now = System.currentTimeMillis();
+
+            File dir = new File(tasksDirectory);
+            File[] files = dir.listFiles();
+            for (int i = 0; i < files.length; i++) {
+                File file = files[i];
+                if (file.getName().endsWith("properties")) {
+                    getLogger().info("Touching file "+file.getName());
+
+                    file.setLastModified(now);
+                }
+            }
+        }
+    }
+
+    private boolean isEmpty() {
+        try {
+            Client client = clientManager.getClient();
+
+            Session session = client.getSession();
+            Queue queue = session.createQueue(buildTaskQueue);
+            QueueBrowser browser = session.createBrowser(queue);
+
+            Enumeration enumeration = browser.getEnumeration();
+            boolean empty = !enumeration.hasMoreElements();
+            return empty;
+        } catch (JMSException e) {
+            throw (IllegalStateException)new IllegalStateException("JMS Failure").initCause(e);
+        }
+    }
+}

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml?rev=367548&r1=367547&r2=367548&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml (original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/resources/META-INF/plexus/components.xml Tue
Jan 10 02:07:19 2006
@@ -128,6 +128,26 @@
       </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
     -->

Modified: geronimo/gbuild/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/pom.xml?rev=367548&r1=367547&r2=367548&view=diff
==============================================================================
--- geronimo/gbuild/trunk/pom.xml (original)
+++ geronimo/gbuild/trunk/pom.xml Tue Jan 10 02:07:19 2006
@@ -97,6 +97,7 @@
   </build>
   <modules>
     <module>gbuild-agent</module>
+    <module>gbuild-agent-web</module>
     <module>gbuild-report</module>
     <module>gbuild-agent-application</module>
   </modules>
@@ -153,11 +154,6 @@
       <groupId>org.apache.maven.scm</groupId>
       <artifactId>maven-scm-provider-cvs</artifactId>
       <version>1.0-beta-1-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>geronimo-spec</groupId>
-      <artifactId>geronimo-spec-j2ee</artifactId>
-      <version>1.4-rc4</version>
     </dependency>
     <dependency>
       <groupId>activemq</groupId>



Mime
View raw message