Package org.apache.xmlrpc

Examples of org.apache.xmlrpc.XmlRpcHandler


  public XmlRpcController getController() { return factory.getController(); }

  public Object execute(XmlRpcRequest pRequest) throws XmlRpcException {
    XmlRpcServer server = (XmlRpcServer) getController();
    XmlRpcHandlerMapping mapping = server.getHandlerMapping();
    XmlRpcHandler handler = mapping.getHandler(pRequest.getMethodName());
    return handler.execute(pRequest);
  }
View Full Code Here


    return map;
  }

  public XmlRpcHandler getHandler(String handlerName)
      throws XmlRpcNoSuchHandlerException, XmlRpcException {
    XmlRpcHandler result = (XmlRpcHandler) handlerMap.get(handlerName);
    if (result == null) {
      throw new XmlRpcNoSuchHandlerException("No such handler: " + handlerName);
    }
    return result;
  }
View Full Code Here

        if (method.getDeclaringClass() == Object.class) {
          continue// Ignore methods from Object.class
        }
        String name = key + "." + method.getName();
        if (!map.containsKey(name)) {
          map.put(name, new XmlRpcHandler(){
            public Object execute(XmlRpcRequest pRequest) throws XmlRpcException {
              Object[] args = new Object[pRequest.getParameterCount()];
              for (int j = 0;  j < args.length;  j++) {
                args[j] = pRequest.getParameter(j);
              }
View Full Code Here

     * @throws XmlRpcNoSuchHandlerException A handler with the given
     * name is unknown.
     */
    public XmlRpcHandler getHandler(String pHandlerName)
            throws XmlRpcNoSuchHandlerException, XmlRpcException {
        XmlRpcHandler result = (XmlRpcHandler) handlerMap.get(pHandlerName);
        if (result == null) {
            throw new XmlRpcNoSuchHandlerException("No such handler: " + pHandlerName);
        }
        return result;
    }
View Full Code Here

   
    return (String[]) list.toArray(new String[list.size()]);
  }

  public String getMethodHelp(String pHandlerName) throws XmlRpcException {
    XmlRpcHandler h = getHandler(pHandlerName);
    if (h instanceof XmlRpcMetaDataHandler)
      return ((XmlRpcMetaDataHandler)h).getMethodHelp();
    throw new XmlRpcNoSuchHandlerException("No help available for method: "
        + pHandlerName);
  }
View Full Code Here

    throw new XmlRpcNoSuchHandlerException("No help available for method: "
        + pHandlerName);
  }

  public String[][] getMethodSignature(String pHandlerName) throws XmlRpcException {
    XmlRpcHandler h = getHandler(pHandlerName);
    if (h instanceof XmlRpcMetaDataHandler)
      return ((XmlRpcMetaDataHandler)h).getSignatures();
    throw new XmlRpcNoSuchHandlerException("No metadata available for method: "
        + pHandlerName);
  }
View Full Code Here

        nameToHandler.put("hello", new HelloXmlRpcHandler());

        serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {

            public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
                XmlRpcHandler handler = nameToHandler.get(handlerName);
                if (handler != null) {
                    return handler;
                }
                throw new XmlRpcNoSuchHandlerException("No handler for method " + handlerName);
            }
View Full Code Here

        this.webServer = new WebServer(client_port);
        XmlRpcServer serverToHandleRawInput = this.webServer.getXmlRpcServer();
        serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {

            public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
                return new XmlRpcHandler() {

                    public Object execute(XmlRpcRequest request) throws XmlRpcException {
                        return "input_request";
                    }
                };
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.XmlRpcHandler

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.