continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r442611 - in /maven/continuum/trunk/continuum-webapp: ./ src/main/java/org/apache/maven/continuum/web/xmlrpc/ src/main/resources/META-INF/plexus/
Date Tue, 12 Sep 2006 14:57:32 GMT
Author: evenisse
Date: Tue Sep 12 07:57:31 2006
New Revision: 442611

URL: http://svn.apache.org/viewvc?view=rev&rev=442611
Log:
Add xml-rpc service

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java
  (with props)
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java
  (with props)
Modified:
    maven/continuum/trunk/continuum-webapp/pom.xml
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml

Modified: maven/continuum/trunk/continuum-webapp/pom.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/pom.xml?view=diff&rev=442611&r1=442610&r2=442611
==============================================================================
--- maven/continuum/trunk/continuum-webapp/pom.xml (original)
+++ maven/continuum/trunk/continuum-webapp/pom.xml Tue Sep 12 07:57:31 2006
@@ -218,6 +218,15 @@
       <artifactId>continuum-notifier-msn</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.maven.continuum</groupId>
+      <artifactId>continuum-xmlrpc</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-xmlrpc</artifactId>
+      <version>1.0-beta-4</version>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-mail-sender-javamail</artifactId>
     </dependency>

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java?view=auto&rev=442611
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java
Tue Sep 12 07:57:31 2006
@@ -0,0 +1,97 @@
+package org.apache.maven.continuum.web.xmlrpc;
+
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.continuum.xmlrpc.ContinuumXmlRpc;
+import org.apache.xmlrpc.XmlRpcException;
+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 org.codehaus.plexus.xmlrpc.XmlRpcServer;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class DefaultXmlRpcService
+    extends AbstractLogEnabled
+    implements XmlRpcService, Startable
+{
+    /**
+     * @plexus.requirement
+     */
+    private XmlRpcServer xmlRpcServer;
+
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumXmlRpc handler;
+
+    /**
+     * port activity flag
+     *
+     * @plexus.configuration default-value="8000"
+     */
+    int port;
+
+    /**
+     * @plexus.configuration default-value="continuum"
+     */
+    private String handlerName;
+
+    public void start()
+        throws StartingException
+    {
+        getLogger().info( "Starting XML-RPC service." );
+
+        try
+        {
+            xmlRpcServer.addListener( null, port, false );
+
+            xmlRpcServer.startListener( null, port );
+
+            getLogger().info( "Adding XML-RPC handler for role '" + handler.ROLE + " to name
'" + handlerName + "'." );
+
+            xmlRpcServer.addHandler( null, handlerName, port, handler );
+        }
+        catch ( XmlRpcException e )
+        {
+            throw new StartingException( "Error while starting XML-RPC server on port " +
port + ".", e );
+        }
+    }
+
+    public void stop()
+        throws StoppingException
+    {
+        getLogger().info( "Stopping XML-RPC service." );
+
+        if ( port == -1 )
+        {
+            return;
+        }
+
+        try
+        {
+            xmlRpcServer.removeListener( null, port );
+        }
+        catch ( XmlRpcException e )
+        {
+            getLogger().error( "Error while stopping the XML-RPC server.", e );
+        }
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/DefaultXmlRpcService.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java?view=auto&rev=442611
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java
Tue Sep 12 07:57:31 2006
@@ -0,0 +1,26 @@
+package org.apache.maven.continuum.web.xmlrpc;
+
+/*
+ * Copyright 2004-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public interface XmlRpcService
+{
+    static final String ROLE = XmlRpcService.class.getName();
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/xmlrpc/XmlRpcService.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?view=diff&rev=442611&r1=442610&r2=442611
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
Tue Sep 12 07:57:31 2006
@@ -11,9 +11,35 @@
       <role>org.codehaus.plexus.taskqueue.execution.TaskQueueExecutor</role>
       <role-hint>check-out-project</role-hint>
     </component>
+    <component>
+      <role>org.apache.maven.continuum.web.xmlrpc.XmlRpcService</role>
+    </component>
   </load-on-start>
 
   <components>
+    <!--
+    | The XML-RPC service
+    |-->
+    <component>
+      <role>org.apache.maven.continuum.web.xmlrpc.XmlRpcService</role>
+      <implementation>org.apache.maven.continuum.web.xmlrpc.DefaultXmlRpcService</implementation>
+      <description></description>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.plexus.xmlrpc.XmlRpcServer</role>
+          <field-name>xmlRpcServer</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.continuum.xmlrpc.ContinuumXmlRpc</role>
+          <field-name>handler</field-name>
+        </requirement>
+      </requirements>
+      <configuration>
+        <port>8000</port>
+        <handler-name>continuum</handler-name>
+      </configuration>
+    </component>
+
     <!--
     | The mail notifier
     |-->



Mime
View raw message