]> source.dussan.org Git - archiva.git/commitdiff
Moved ArchivaRequestProcessorFactory into ArchivaRequestProcessorFactoryFactory
authorJames William Dumay <jdumay@apache.org>
Thu, 28 Aug 2008 04:13:56 +0000 (04:13 +0000)
committerJames William Dumay <jdumay@apache.org>
Thu, 28 Aug 2008 04:13:56 +0000 (04:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-124@689710 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-server/src/main/java/org/apache/maven/archiva/web/xmlrpc/server/ArchivaRequestProcessorFactory.java [deleted file]
archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-server/src/main/java/org/apache/maven/archiva/web/xmlrpc/server/ArchivaRequestProcessorFactoryFactory.java

diff --git a/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-server/src/main/java/org/apache/maven/archiva/web/xmlrpc/server/ArchivaRequestProcessorFactory.java b/archiva-modules/archiva-web/archiva-xmlrpc/archiva-xmlrpc-server/src/main/java/org/apache/maven/archiva/web/xmlrpc/server/ArchivaRequestProcessorFactory.java
deleted file mode 100644 (file)
index 671e317..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-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 org.apache.xmlrpc.XmlRpcException;\r
-import org.apache.xmlrpc.XmlRpcRequest;\r
-import org.apache.xmlrpc.server.RequestProcessorFactoryFactory;\r
-\r
-/**\r
- * Service an instance of the service object\r
- */\r
-public class ArchivaRequestProcessorFactory implements RequestProcessorFactoryFactory.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
index 7229a39bc6b8e6fa1c6277e5067a2bcacd404a68..d70e7f01e709e676b0d68ea548aced51dcc8e066 100644 (file)
@@ -23,30 +23,49 @@ 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
-import org.apache.xmlrpc.server.RequestProcessorFactoryFactory.RequestProcessorFactory;\r
 \r
 public class ArchivaRequestProcessorFactoryFactory implements RequestProcessorFactoryFactory\r
 {\r
-    private final Map<Class, Object> services;\r
+    private final Map<Class, ArchivaRequestProcessorFactory> services;\r
 \r
     public ArchivaRequestProcessorFactoryFactory(List serviceList)\r
     {\r
-        services = new HashMap<Class, Object>();\r
+        services = new HashMap<Class, ArchivaRequestProcessorFactory>();\r
         for (Object service : serviceList)\r
         {\r
-            services.put(service.getClass(), service);\r
+            services.put(service.getClass(), new ArchivaRequestProcessorFactory(service.getClass(), service));\r
         }\r
     }\r
 \r
     public RequestProcessorFactory getRequestProcessorFactory(Class pClass)\r
         throws XmlRpcException\r
     {\r
-        Object object = services.get(pClass);\r
-        if (object == null)\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 new ArchivaRequestProcessorFactory(pClass, object);\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