Package org.apache.xmlrpc.server

Examples of org.apache.xmlrpc.server.PropertyHandlerMapping


         webServer = new XblWebServer(xmlRpcUrl, socketUrl, addressServer);
         // publish the public methods to the XmlRpc web server:
         // webServer.addHandler("authenticate", new AuthenticateImpl(glob, this, authenticate));
         // webServer.addHandler("xmlBlaster", new XmlBlasterImpl(glob, this, xmlBlasterImpl));
        
         PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        
         XmlBlasterImpl xblImpl = new XmlBlasterImpl(glob, this, xmlBlasterImpl);
         AuthenticateImpl auImpl = new AuthenticateImpl(glob, this, authenticate, xblImpl);
        
         XblRequestFactoryFactory factoryFactory = new XblRequestFactoryFactory();
         factoryFactory.add(auImpl);
         factoryFactory.add(xblImpl);
         mapping.setRequestProcessorFactoryFactory(factoryFactory);
        
         mapping.addHandler("authenticate", auImpl.getClass());      // register update() method
         mapping.addHandler("xmlBlaster", xblImpl.getClass());
        
         XmlRpcHttpServer xmlRpcServer = (XmlRpcHttpServer)webServer.getXmlRpcServer();
         XmlRpcServerConfigImpl serverCfg = new XmlRpcServerConfigImpl();
         serverCfg.setEnabledForExceptions(true);
         serverCfg.setEnabledForExtensions(true);
View Full Code Here


            }
           
            boolean inhibitCbExceptions = callbackAddress.getEnv("inhibitCbExceptions", false).getValue();
           
            XmlRpcCallbackImpl xblImpl = new XmlRpcCallbackImpl(this, inhibitCbExceptions);
            PropertyHandlerMapping mapping = new PropertyHandlerMapping();
            XblRequestFactoryFactory factoryFactory = new XblRequestFactoryFactory();
            factoryFactory.add(xblImpl);
            mapping.setRequestProcessorFactoryFactory(factoryFactory);
            mapping.addHandler("$default", xblImpl.getClass());      // register update() method

            this.callbackAddress.setRawAddress(this.xmlRpcUrlCallback.getUrl()); // e.g. "http://127.168.1.1:8082/"
            this.ME = "XmlRpcCallbackServer-" + this.xmlRpcUrlCallback.getUrl();
            //log.info(ME, "Created XmlRpc callback http server");
        
View Full Code Here

    public static void main(String[] args) throws Exception {
        WebServer webServer = new WebServer(port);

        XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();

        PropertyHandlerMapping phm = new PropertyHandlerMapping();
        /*
         * Load handler definitions from a property file.
         * The property file might look like:
         * Calculator=org.apache.xmlrpc.demo.Calculator
         * org.apache.xmlrpc.demo.proxy.Adder=org.apache.xmlrpc.demo.proxy.AdderImpl
         */
        phm.load(Thread.currentThread().getContextClassLoader(), "org/apache/xmlrpc/webserver/XmlRpcServlet.properties");

        /*
         * You may also provide the handler classes directly, like this:
         * phm.addHandler("Calculator", org.apache.xmlrpc.demo.Calculator.class);
         * phm.addHandler(org.apache.xmlrpc.demo.proxy.Adder.class.getName(), org.apache.xmlrpc.demo.proxy.AdderImpl.class);
View Full Code Here

    private XmlRpcServlet servlet;
    private MyServletWebServer server;
    private MyWebServer webServer;

    private XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws XmlRpcException {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        mapping.addHandler("Adder", Adder.class);
        return mapping;
    }
View Full Code Here

* Test class for the introspection stuff.
*/
public class MetadataTest extends XmlRpcTestCase {
    protected XmlRpcHandlerMapping getHandlerMapping() throws IOException,
            XmlRpcException {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        mapping.addHandler("Adder", AuthenticationTest.AdderImpl.class);
        XmlRpcSystemImpl.addSystemHandler(mapping);
        return mapping;
    }
View Full Code Here

  /** Creates a new instance of {@link PropertyHandlerMapping} by
   * loading the property file from the given URL. Called from
   * {@link #newXmlRpcHandlerMapping()}.
   */
  protected PropertyHandlerMapping newPropertyHandlerMapping(URL url) throws IOException, XmlRpcException {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        mapping.setAuthenticationHandler(authenticationHandler);
        if (requestProcessorFactoryFactory != null) {
            mapping.setRequestProcessorFactoryFactory(requestProcessorFactoryFactory);
        }
        if (typeConverterFactory != null) {
            mapping.setTypeConverterFactory(typeConverterFactory);
        } else {
            mapping.setTypeConverterFactory(server.getTypeConverterFactory());
        }
        mapping.setVoidMethodEnabled(server.getConfig().isEnabledForExtensions());
        mapping.load(Thread.currentThread().getContextClassLoader(), url);
        return mapping;
  }
View Full Code Here

            return cal.getTime();
        }
    }
   
    protected XmlRpcHandlerMapping getHandlerMapping() throws IOException, XmlRpcException {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        mapping.addHandler("DateConverter", DateConverter.class);
        return mapping;
    }
View Full Code Here

        config.setEnabledForExceptions(true);
        return config;
    }

    protected XmlRpcHandlerMapping getHandlerMapping(String pResource) throws IOException, XmlRpcException {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        mapping.setVoidMethodEnabled(true);
        mapping.load(getClass().getClassLoader(), getClass().getResource(pResource));
        mapping.setTypeConverterFactory(getTypeConverterFactory());
        return mapping;
    }
View Full Code Here

    }
   
    private WebServer startXmlRpcWebServer () throws Exception {
        WebServer webServer = new WebServer(10301);       
        XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();
        PropertyHandlerMapping phm = new PropertyHandlerMapping();
        phm.addHandler("Calculator", Calculator.class);
        phm.addHandler("EchoService", EchoService.class);
        xmlRpcServer.setHandlerMapping(phm);
       
        webServer.start();
        return webServer;
    }
View Full Code Here

        config.setEnabledForExtensions(true);
        return config;
    }

    protected XmlRpcHandlerMapping getHandlerMapping(String pResource) throws IOException, XmlRpcException {
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        mapping.load(getClass().getClassLoader(), getClass().getResource(pResource));
        mapping.setTypeConverterFactory(getTypeConverterFactory());
        return mapping;
    }
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.server.PropertyHandlerMapping

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.