• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java XmlRpcServer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.xmlrpc.server.XmlRpcServer的典型用法代码示例。如果您正苦于以下问题:Java XmlRpcServer类的具体用法?Java XmlRpcServer怎么用?Java XmlRpcServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlRpcServer类属于org.apache.xmlrpc.server包,在下文中一共展示了XmlRpcServer类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: PyUnitServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
/**
 * As we need to be able to relaunch, we store the configuration and launch here (although the relaunch won't be
 * actually done in this class, this is the place to get information on it).
 * 
 * @param config used to get the configuration of the launch.
 * @param launch the actual launch
 * @throws IOException
 */
public PyUnitServer(PythonRunnerConfig config, ILaunch launch) throws IOException {
    initializeDispatches();
    port = SocketUtil.findUnusedLocalPorts(1)[0];
    this.webServer = new WebServer(port);
    XmlRpcServer serverToHandleRawInput = this.webServer.getXmlRpcServer();
    serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {

        @Override
        public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
            return handler;
        }
    });

    this.webServer.start();

    ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
    launchManager.addLaunchListener(this.launchListener);
    this.launch = launch;
    this.configuration = config.getLaunchConfiguration();
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:29,代码来源:PyUnitServer.java


示例2: start

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
@BeforeClass
public static void start() throws IOException, XmlRpcException {
  webServer = new WebServer(0);
  XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();

  PropertyHandlerMapping phm = new PropertyHandlerMapping();

  phm.addHandler("Loopback", LoopbackClass.class);
  xmlRpcServer.setHandlerMapping(phm);

  XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
  serverConfig.setEnabledForExtensions(false);
  serverConfig.setContentLengthOptional(false);

  webServer.start();

  XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
  config.setServerURL(new URL("http://127.0.0.1:" + webServer.getPort() + "/xmlrpc"));
  client = new XmlRpcClient();
  client.setConfig(config);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:22,代码来源:FlatteningViaXmlRpcTest.java


示例3: server

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
private static void server() throws IOException, XmlRpcException {
    WebServer webServer = new WebServer(8089);

    XmlRpcServer xmlRpcServer = webServer.getXmlRpcServer();

    PropertyHandlerMapping mapping = new PropertyHandlerMapping();

    mapping.addHandler(POWRemoteAPI.class.getName(), POWServerAPI.class);
    
    POWRemoteAPI api = (POWRemoteAPI) Util.newInstance(POWServerAPI.class);

    mapping.setRequestProcessorFactoryFactory(
            new RequestProcessorFactoryFactory.RequestSpecificProcessorFactoryFactory() {
        @Override
        protected Object getRequestProcessor(Class pClass, XmlRpcRequest pRequest) throws XmlRpcException {
            return api;
        }
    });

    xmlRpcServer.setHandlerMapping(mapping);

    XmlRpcServerConfigImpl serverConfig
            = (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
    serverConfig.setEnabledForExtensions(true);
    serverConfig.setContentLengthOptional(false);

    webServer.start();
    
    api.blinkStatusLED(500, 500);
}
 
开发者ID:miho,项目名称:PiOnWheels,代码行数:31,代码来源:Main.java


示例4: startRpcServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
private void startRpcServer() {
    try {
        rpcServer = new WebServer(8000);
        XmlRpcServer xmlRpcServer = rpcServer.getXmlRpcServer();
        PropertyHandlerMapping mapper = new PropertyHandlerMapping();
        mapper.addHandler("Signals", signals.getClass());
        xmlRpcServer.setHandlerMapping(mapper);
        rpcServer.start();
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:jasiowka,项目名称:appinpy,代码行数:14,代码来源:UnityIndicator.java


示例5: startServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
private Process startServer(int client_port, int port, boolean python) throws IOException {
    File f = new File(TestDependent.TEST_PYDEV_PLUGIN_LOC + "pysrc/pydevconsole.py");

    String[] cmdLine;
    if (python) {
        cmdLine = new String[] { TestDependent.PYTHON_EXE, "-u", FileUtils.getFileAbsolutePath(f), "" + port,
                "" + client_port };
    } else {
        cmdLine = new String[] { TestDependent.JAVA_LOCATION, "-classpath", TestDependent.JYTHON_JAR_LOCATION,
                "org.python.util.jython", FileUtils.getFileAbsolutePath(f), "" + port, "" + client_port };
    }

    Process process = Runtime.getRuntime().exec(cmdLine);
    err = new ThreadStreamReader(process.getErrorStream());
    out = new ThreadStreamReader(process.getInputStream());
    err.start();
    out.start();

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

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

                @Override
                public Object execute(XmlRpcRequest request) throws XmlRpcException {
                    return "input_request";
                }
            };
        }
    });

    this.webServer.start();
    return process;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:38,代码来源:XmlRpcTest.java


示例6: getXmlRpcServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
public XmlRpcServer getXmlRpcServer() {
    return xmlRpcServer;
}
 
开发者ID:stacksync,项目名称:stacksync-quota-server,代码行数:4,代码来源:XmlRpcQuotaServer.java


示例7: setXmlRpcServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
public void setXmlRpcServer(XmlRpcServer xmlRpcServer) {
    this.xmlRpcServer = xmlRpcServer;
}
 
开发者ID:stacksync,项目名称:stacksync-quota-server,代码行数:4,代码来源:XmlRpcQuotaServer.java


示例8: PydevConsoleCommunication

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
/**
 * Initializes the xml-rpc communication.
 *
 * @param port the port where the communication should happen.
 * @param process this is the process that was spawned (server for the XML-RPC)
 *
 * @throws MalformedURLException
 */
public PydevConsoleCommunication(int port, final Process process, int clientPort, String[] commandArray,
        String[] envp, String encoding)
        throws Exception {
    this.commandArray = commandArray;
    this.envp = envp;

    finishedExecution = new ConditionEvent(new ICallback0<Boolean>() {

        @Override
        public Boolean call() {
            try {
                process.exitValue();
                return true; // already exited
            } catch (Exception e) {
                return false;
            }
        }
    }, 200);

    //start the server that'll handle input requests
    this.webServer = new WebServer(clientPort);
    XmlRpcServer serverToHandleRawInput = this.webServer.getXmlRpcServer();
    serverToHandleRawInput.setHandlerMapping(new XmlRpcHandlerMapping() {

        @Override
        public XmlRpcHandler getHandler(String handlerName) throws XmlRpcNoSuchHandlerException, XmlRpcException {
            return PydevConsoleCommunication.this;
        }
    });

    this.webServer.start();
    this.stdStreamsThread = new StdStreamsThread(process, encoding);
    this.stdStreamsThread.start();

    IXmlRpcClient client = new ScriptXmlRpcClient(process);
    client.setPort(port);

    this.client = client;

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:49,代码来源:PydevConsoleCommunication.java


示例9: getXmlRpcServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
public XmlRpcServer getXmlRpcServer() {
	return xmlRpcServer;
}
 
开发者ID:stacksync,项目名称:sync-service,代码行数:4,代码来源:XmlRpcSyncServer.java


示例10: setXmlRpcServer

import org.apache.xmlrpc.server.XmlRpcServer; //导入依赖的package包/类
public void setXmlRpcServer(XmlRpcServer xmlRpcServer) {
	this.xmlRpcServer = xmlRpcServer;
}
 
开发者ID:stacksync,项目名称:sync-service,代码行数:4,代码来源:XmlRpcSyncServer.java



注:本文中的org.apache.xmlrpc.server.XmlRpcServer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ModelBlock类代码示例发布时间:2022-05-22
下一篇:
Java DashSegmentIndex类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap