<groupId>org.apache.archiva</groupId>
<artifactId>archiva-rss</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.apache.archiva</groupId>
+ <artifactId>archiva-xmlrpc-services</artifactId>
+ </dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<artifactId>commons-logging-api</artifactId>
<version>1.1</version>
</dependency>
+ <dependency>
+ <groupId>com.atlassian.xmlrpc</groupId>
+ <artifactId>atlassian-xmlrpc-binder-server-spring</artifactId>
+ <scope>runtime</scope>
+ </dependency>
</dependencies>
<build>
<resources>
<bean id="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:application.properties" />
</bean>
+
+
+ <bean name="testXmlRpcService" lazy-init="true" scope="singleton" class="org.apache.maven.archiva.web.xmlrpc.services.PingServiceImpl"/>
+
+ <bean name="xmlrpcServicesList" class="java.util.ArrayList">
+ <constructor-arg>
+ <ref bean="testXmlRpcService"/>
+ </constructor-arg>
+ </bean>
+
</beans>
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ specific language governing permissions and limitations
~ under the License.
-->
-
-<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Apache Archiva</display-name>
<!-- Loading this on startup so as to take advantage of configuration listeners -->
<load-on-startup>1</load-on-startup>
</servlet>
+
+ <servlet>
+ <servlet-name>XmlRpcServlet</servlet-name>
+ <servlet-class>com.atlassian.xmlrpc.spring.BinderSpringXmlRpcServlet</servlet-class>
+ <init-param>
+ <param-name>serviceListBeanName</param-name>
+ <param-value>xmlrpcServicesList</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
<servlet>
<servlet-name>RssFeedServlet</servlet-name>
<url-pattern>/repository/*</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>XmlRpcServlet</servlet-name>
+ <url-pattern>/xmlrpc</url-pattern>
+ </servlet-mapping>
+
<resource-ref>
<res-ref-name>jdbc/users</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
-
</web-app>
<version>1.2-SNAPSHOT</version>
</parent>
- <artifactId>archiva-xmlrpc-server</artifactId>
- <name>Archiva Web :: XML-RPC Server</name>
+ <artifactId>archiva-xmlrpc-services</artifactId>
+ <name>Archiva Web :: XML-RPC Services</name>
<dependencies>
<dependency>
<groupId>org.apache.archiva</groupId>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
- <dependency>
- <groupId>com.atlassian.xmlrpc</groupId>
- <artifactId>atlassian-xmlrpc-binder-server</artifactId>
- </dependency>
</dependencies>
</project>
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.server;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import java.util.Map;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import org.apache.xmlrpc.XmlRpcException;\r
-import org.apache.xmlrpc.XmlRpcRequest;\r
-import org.apache.xmlrpc.server.RequestProcessorFactoryFactory;\r
-\r
-public class ArchivaRequestProcessorFactoryFactory implements RequestProcessorFactoryFactory\r
-{\r
- private final Map<Class, ArchivaRequestProcessorFactory> services;\r
-\r
- public ArchivaRequestProcessorFactoryFactory(List serviceList)\r
- {\r
- services = new HashMap<Class, ArchivaRequestProcessorFactory>();\r
- for (Object service : serviceList)\r
- {\r
- services.put(service.getClass(), new ArchivaRequestProcessorFactory(service.getClass(), service));\r
- }\r
- }\r
-\r
- public RequestProcessorFactory getRequestProcessorFactory(Class pClass)\r
- throws XmlRpcException\r
- {\r
- ArchivaRequestProcessorFactory processorFactory = services.get(pClass);\r
- if (processorFactory == null)\r
- {\r
- throw new XmlRpcException("Could not find service object instance for type " + pClass.getName());\r
- }\r
- return processorFactory;\r
- }\r
- \r
- private class ArchivaRequestProcessorFactory implements RequestProcessorFactory\r
- {\r
- private final Class pType;\r
-\r
- private final Object serviceObject;\r
-\r
- public ArchivaRequestProcessorFactory(Class pType, Object serviceObject)\r
- {\r
- this.pType = pType;\r
- this.serviceObject = serviceObject;\r
- }\r
-\r
- public Object getRequestProcessor(XmlRpcRequest request)\r
- throws XmlRpcException\r
- {\r
- return serviceObject;\r
- }\r
- }\r
-}\r
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.server;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import com.atlassian.xmlrpc.BinderXmlRpcServlet;\r
-import java.util.List;\r
-import javax.servlet.ServletConfig;\r
-import javax.servlet.ServletException;\r
-import org.apache.xmlrpc.XmlRpcException;\r
-import org.apache.xmlrpc.XmlRpcRequest;\r
-import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler;\r
-import org.springframework.context.ApplicationContext;\r
-import org.springframework.web.context.support.WebApplicationContextUtils;\r
-\r
-public class ArchivaXmlRpcServlet extends BinderXmlRpcServlet\r
-{\r
- private final String XMLRPC_SERVICES_BEAN_NAME = "xmlrpcServices";\r
-\r
- private ApplicationContext context;\r
-\r
- @Override\r
- public void init(ServletConfig pConfig)\r
- throws ServletException\r
- {\r
- super.init(pConfig);\r
- \r
- context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());\r
- setAuthenticationHandler(new ArchivaAuthenticationHandler());\r
- initRequestProcessorFactoryFactory();\r
- }\r
-\r
- private void initRequestProcessorFactoryFactory() throws ServletException\r
- {\r
- List serviceList = (List)context.getBean(XMLRPC_SERVICES_BEAN_NAME);\r
- if (serviceList == null)\r
- {\r
- throw new ServletException("Could not find bean " + XMLRPC_SERVICES_BEAN_NAME);\r
- }\r
-\r
- setRequestProcessorFactoryFactory(new ArchivaRequestProcessorFactoryFactory(serviceList));\r
- }\r
-\r
- /**\r
- * Servlet Security\r
- */\r
- private class ArchivaAuthenticationHandler implements AuthenticationHandler\r
- {\r
- public boolean isAuthorized(XmlRpcRequest request) throws XmlRpcException {\r
- return false;\r
- }\r
- }\r
-}\r
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.server.services;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import org.apache.maven.archiva.web.xmlrpc.api.TestService;\r
-\r
-public class PingServiceImpl implements TestService\r
-{\r
- public String ping()\r
- {\r
- return "pong";\r
- }\r
-}\r
--- /dev/null
+package org.apache.maven.archiva.web.xmlrpc.services;\r
+\r
+/*\r
+ * Licensed to the Apache Software Foundation (ASF) under one\r
+ * or more contributor license agreements. See the NOTICE file\r
+ * distributed with this work for additional information\r
+ * regarding copyright ownership. The ASF licenses this file\r
+ * to you under the Apache License, Version 2.0 (the\r
+ * "License"); you may not use this file except in compliance\r
+ * with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing,\r
+ * software distributed under the License is distributed on an\r
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+ * KIND, either express or implied. See the License for the\r
+ * specific language governing permissions and limitations\r
+ * under the License.\r
+ */\r
+\r
+import org.apache.maven.archiva.web.xmlrpc.api.TestService;\r
+\r
+public class PingServiceImpl implements TestService\r
+{\r
+ public String ping()\r
+ {\r
+ return "pong";\r
+ }\r
+}\r
</dependency>
<dependency>
<groupId>org.apache.archiva</groupId>
- <artifactId>archiva-xmlrpc-server</artifactId>
+ <artifactId>archiva-xmlrpc-services</artifactId>
<version>1.2-SNAPSHOT</version>
</dependency>
<dependency>
<dependency>
<groupId>com.atlassian.xmlrpc</groupId>
<artifactId>atlassian-xmlrpc-binder-annotations</artifactId>
- <version>0.5</version>
+ <version>0.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.atlassian.xmlrpc</groupId>
- <artifactId>atlassian-xmlrpc-binder-server</artifactId>
- <version>0.5</version>
+ <artifactId>atlassian-xmlrpc-binder-server-spring</artifactId>
+ <version>0.6-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<dependency>
<groupId>com.atlassian.xmlrpc</groupId>
<artifactId>atlassian-xmlrpc-binder</artifactId>
- <version>0.5</version>
+ <version>0.6-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.atlassian.xmlrpc</groupId>
<artifactId>atlassian-xmlrpc-binder-testing</artifactId>
- <version>0.5</version>
+ <version>0.6-SNAPSHOT</version>
<scope>test</scope>
</dependency>