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

Java PropertyHandlerMapping类代码示例

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

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



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

示例1: AnalysisRpcServer

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的package包/类
/**
 * Create a new AnalysisRpc server that listens on the given port
 *
 * @param port
 *          to listen on, or 0 to allocate port automatically
 */
public AnalysisRpcServer(int port) {
  try {
    webServer = new AnalysisRpcWebServer(port, InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 }));
  } catch (UnknownHostException e1) {
    logger.error("Failed to get InetAddress of localhost", e1);
  }

  xmlRpcServer = webServer.getXmlRpcServer();

  PropertyHandlerMapping phm = new PropertyHandlerMapping();
  AnalysisRpcServerHandler handler = new AnalysisRpcServerHandlerImpl(this);
  phm.setRequestProcessorFactoryFactory(new HandlerRequestProcessorFactoryFactory(handler));

  try {
    phm.addHandler("Analysis", AnalysisRpcServerHandler.class);
  } catch (XmlRpcException e) {
    logger.error("Failed to addHandler for 'Analysis' to XML-RPC Server", e);
  }
  xmlRpcServer.setHandlerMapping(phm);

  XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) xmlRpcServer.getConfig();
  serverConfig.setEnabledForExtensions(false);
  serverConfig.setContentLengthOptional(false);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:31,代码来源:AnalysisRpcServer.java


示例2: start

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的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: XmlRpcQuotaServer

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的package包/类
public XmlRpcQuotaServer(int port) throws Exception {
    this.port = port;
    // bind
    this.webServer = new WebServer(this.port);
    this.xmlRpcServer = this.webServer.getXmlRpcServer();
    this.handler = new XmlRpcRequestHandlerFactory();

    this.phm = new PropertyHandlerMapping();
    this.phm.setRequestProcessorFactoryFactory(this.handler);

}
 
开发者ID:stacksync,项目名称:stacksync-quota-server,代码行数:12,代码来源:XmlRpcQuotaServer.java


示例4: server

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的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


示例5: addHandler

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的package包/类
/**
 * Adds a handler to the webserver.
 * 
 * @param handlerName handler name
 * @param clazz class of server interface
 * @throws FatalESException in case of failure
 */
public void addHandler(String handlerName, Class<?> clazz) throws FatalESException {
	try {
		final PropertyHandlerMapping mapper = (PropertyHandlerMapping) webServer.getXmlRpcServer()
			.getHandlerMapping();
		mapper.addHandler(handlerName, clazz);
	} catch (final XmlRpcException e) {
		throw new FatalESException("Couldn't add handler", e);
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:17,代码来源:XmlRpcWebserverManager.java


示例6: removeHandler

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的package包/类
/**
 * Removes a handler from the Webserver.
 * 
 * @param handlerName the handler's name
 * @return true, if other handler still available
 */
public boolean removeHandler(String handlerName) {
	final PropertyHandlerMapping mapper = (PropertyHandlerMapping) webServer.getXmlRpcServer().getHandlerMapping();
	mapper.removeHandler(handlerName);
	try {
		return mapper.getListMethods().length > 0;
	} catch (final XmlRpcException e) {
		return false;
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:16,代码来源:XmlRpcWebserverManager.java


示例7: startRpcServer

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的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


示例8: XmlRpcSyncServer

import org.apache.xmlrpc.server.PropertyHandlerMapping; //导入依赖的package包/类
public XmlRpcSyncServer(int port) throws Exception {
	this.port = port;
	// bind
	this.webServer = new WebServer(this.port);
	this.xmlRpcServer = this.webServer.getXmlRpcServer();
	this.handler = new XmlRpcRequestHandlerFactory();

	this.phm = new PropertyHandlerMapping();
	this.phm.setRequestProcessorFactoryFactory(this.handler);

}
 
开发者ID:stacksync,项目名称:sync-service,代码行数:12,代码来源:XmlRpcSyncServer.java


示例9: getPhm

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


示例10: setPhm

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


示例11: getPhm

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


示例12: setPhm

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java BindingFactory类代码示例发布时间:2022-05-22
下一篇:
Java DTO类代码示例发布时间: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