package com.jetbrains.python.console;

import com.jetbrains.python.console.pydev.PydevConsoleCommunication;
import org.apache.xmlrpc.WebServer;
import org.apache.xmlrpc.XmlRpcHandlerMapping;
import org.apache.xmlrpc.XmlRpcServer;

/**
 * Web server to handle all the input requests by PydevConsoleCommunication
 * @author oleg
 */
public class PydevWebServer extends WebServer {
  public PydevWebServer(int port, final PydevConsoleCommunication communication) {
    super(port, null, new XmlRpcServer(){
      final XmlRpcHandlerMapping xmlRpcHandlerMapping = new XmlRpcHandlerMapping() {
        public Object getHandler(String handlerName) throws Exception {
          return communication;
        }
      };
      @Override
      public XmlRpcHandlerMapping getHandlerMapping() {
        return xmlRpcHandlerMapping;
      }
    });
  }
}

@@ -141,55 +141,8 @@
 er;%0A
-import org.apache.xmlrpc.XmlRpcHandlerMapping;%0A
 impo
@@ -176,16 +176,16 @@
 Server;%0A
+
 %0A/**%0A * 
@@ -430,20 +430,22 @@
 , null, 
-new 
+create
 XmlRpcSe
@@ -453,342 +453,247 @@
 ver(
-)%7B%0A      final XmlRpcHandlerMapping xmlRpcHandlerMapping = new XmlRpcHandlerMapping() %7B%0A        public Object getHandler(String handlerName) throws Exception %7B%0A          return communication;%0A        %7D%0A      %7D;%0A      @Override%0A      public XmlRpcHandlerMapping getHandlerMapping() %7B%0A        return xmlRpcHandlerMapping;%0A      %7D%0A    %7D)
+communication));%0A  %7D%0A%0A  private static XmlRpcServer createXmlRpcServer(final PydevConsoleCommunication communication) %7B%0A    final XmlRpcServer server = new XmlRpcServer();%0A    server.addHandler(%22$default%22, communication);%0A    return server
 ;%0A  

Correct way of registering XML RPC handler