+++ /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 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
*/\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