当前位置: 首页>>代码示例>>Java>>正文


Java XmlRpcStreamConfig类代码示例

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


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

示例1: writeRequest

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
public void writeRequest(XmlRpcStreamConfig config, XmlRpcRequest request) throws SAXException {
    handler.startDocument();
    boolean extensions = config.isEnabledForExtensions();
    if (extensions) {
        handler.startPrefixMapping("ex", org.apache.xmlrpc.serializer.XmlRpcWriter.EXTENSIONS_URI);
    }
    handler.startElement("", "methodCall", "methodCall", ZERO_ATTRIBUTES);
    handler.startElement("", "methodName", "methodName", ZERO_ATTRIBUTES);
    String s = request.getMethodName();
    handler.characters(s.toCharArray(), 0, s.length());
    handler.endElement("", "methodName", "methodName");
    handler.startElement("", "params", "params", ZERO_ATTRIBUTES);
    int num = request.getParameterCount();
    for (int i = 0; i < num; i++) {
        handler.startElement("", "param", "param", ZERO_ATTRIBUTES);
        writeValue(request.getParameter(i));
        handler.endElement("", "param", "param");
    }
    handler.endElement("", "params", "params");
    handler.endElement("", "methodCall", "methodCall");
    if (extensions) {
        handler.endPrefixMapping("ex");
    }
    handler.endDocument();
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:XmlRpcWriter.java

示例2: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName) {
    TypeParser defaultParser = super.getParser(pConfig, pContext, pURI, pLocalName);
    if (defaultParser instanceof I4Parser) {
        return new TolerantI4Parser();
    } else if (defaultParser instanceof DateParser) {
        return new TolerantDateParser(new XmlRpcDateTimeDateFormat(){
            private static final long serialVersionUID = 7585237706442299067L;
            protected TimeZone getTimeZone() {
                return getController().getConfig().getTimeZone();
            }
        });
    } else {
        return defaultParser;
    }
}
 
开发者ID:vmware,项目名称:workflowTools,代码行数:17,代码来源:TolerantTypeFactory.java

示例3: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Correctly handle outgoing requests containing XML-RPC "None" values.
 */
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
    if (pObject == null) {
        return new TypeSerializerImpl() {
            public void write(ContentHandler pHandler, Object o) throws SAXException {
                pHandler.startElement("", VALUE_TAG, VALUE_TAG, ZERO_ATTRIBUTES);
                pHandler.startElement("", NullSerializer.NIL_TAG, NullSerializer.NIL_TAG, ZERO_ATTRIBUTES);
                pHandler.endElement("", NullSerializer.NIL_TAG, NullSerializer.NIL_TAG);
                pHandler.endElement("", VALUE_TAG, VALUE_TAG);
            }
        };
    } else {
        return super.getSerializer(pConfig, pObject);
    }
}
 
开发者ID:vtunka,项目名称:jenkins-koji-plugin,代码行数:19,代码来源:MyTypeFactory.java

示例4: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Serializer.
 */
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException
{
	if (pObject instanceof Date)
	{
		return new DateSerializer(newFormat());
	}
	return super.getSerializer(pConfig, pObject);
}
 
开发者ID:unistra,项目名称:fsp,代码行数:13,代码来源:XmlRpc.java

示例5: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName) {
  if (DoubleSerializer.DOUBLE_TAG.equals(pLocalName)) {
    return new AnalysisRpcDoubleParser();
  }
  return super.getParser(pConfig, pContext, pURI, pLocalName);
}
 
开发者ID:eclipse,项目名称:triquetrum,代码行数:8,代码来源:AnalysisRpcTypeFactoryImpl.java

示例6: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Correctly handle XML-RPC "None" elements in incoming responses from server.
 */
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig,
                            NamespaceContextImpl pContext, String pURI, String pLocalName) {

    if ("".equals(pURI) && NullSerializer.NIL_TAG.equals(pLocalName)) {
        return new NullParser();
    } else {
        return super.getParser(pConfig, pContext, pURI, pLocalName);
    }
}
 
开发者ID:vtunka,项目名称:jenkins-koji-plugin,代码行数:14,代码来源:MyTypeFactory.java

示例7: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI,
	String pLocalName) {
	if (EObjectSerializer.EOBJECT_TAG.equals(pLocalName)) {
		return new EObjectTypeParser();
	} else {
		return super.getParser(pConfig, pContext, pURI, pLocalName);
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:13,代码来源:EObjectTypeFactory.java

示例8: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
	if (pObject instanceof EObject) {
		return new EObjectSerializer();
	} else {
		return super.getSerializer(pConfig, pObject);
	}
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:12,代码来源:EObjectTypeFactory.java

示例9: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
/**
 * Date parser.
 */
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig, NamespaceContextImpl pContext, String pURI, String pLocalName)
{
	if (DateSerializer.DATE_TAG.equals(pLocalName))
	{
		return new DateParser(newFormat());
	}
	return super.getParser(pConfig, pContext, pURI, pLocalName);
}
 
开发者ID:unistra,项目名称:fsp,代码行数:13,代码来源:XmlRpc.java

示例10: getParser

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeParser getParser(XmlRpcStreamConfig pConfig,
        NamespaceContextImpl pContext, String pURI, String pLocalName) {
    if ("".equals(pURI) && NullSerializer.NIL_TAG.equals(pLocalName)) {
        return new NullParser();
    } else if ("i8".equals(pLocalName)) {
        return new LongTypeParser();
    } else {
        return super.getParser(pConfig, pContext, pURI, pLocalName);
    }
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:12,代码来源:RpcTypeFactory.java

示例11: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig,
        Object pObject) throws SAXException {
    if (pObject instanceof Long) {
        return new LongTypeSerializer();
    } else {
        return super.getSerializer(pConfig, pObject);
    }
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:9,代码来源:RpcTypeFactory.java

示例12: callTimeoutInSec

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public Object callTimeoutInSec(String method, List<?> params, int timeout,
        boolean debug) throws XmlRpcException {
    XmlRpcStreamConfig config = new XmlRpcHttpRequestConfigImpl();
    XmlRpcClient client = new XmlRpcClient();
    client.setTypeFactory(new RpcTypeFactory(client));
    XmlRpcResponseParser parser = new XmlRpcResponseParser(
            (XmlRpcStreamRequestConfig) config, client.getTypeFactory());
    XMLReader xr = SAXParsers.newXMLReader();
    xr.setContentHandler(parser);
    try {
        String result = null;
        if (getMethodResponse(method) != null) {
            result = getMethodResponse(method);
            LOGGER.debug("methodresponse call: " + method + " - " + params);
            LOGGER.trace("methodresponse reply: " + result);
        }
        if (result == null && multiRes.size() >= 0) {
            result = getResult();
            LOGGER.debug("getresult call: " + method + " - " + params);
            LOGGER.trace("getresult reply: " + result);
        }
        xr.parse(new InputSource(new StringReader(result)));
    } catch (Exception e) {
        throw new XmlRpcException("Exception: " + e.getMessage(), e);
    }
    if (parser.getErrorCode() != 0) {
        throw new XmlRpcException("Fault received[" + parser.getErrorCode()
                + "]: " + parser.getErrorMessage());
    }
    return parser.getResult();
}
 
开发者ID:apache,项目名称:cloudstack,代码行数:33,代码来源:ConnectionTest.java

示例13: getSerializer

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
@Override
public TypeSerializer getSerializer(XmlRpcStreamConfig pConfig, Object pObject) throws SAXException {
  if (pObject instanceof Double) {
    return new DoubleSerializer();
  } else if (pObject instanceof Integer) {
    return new IntegerSerializer();
  } else {
    return super.getSerializer(pConfig, pObject);
  }
}
 
开发者ID:skimarxall,项目名称:asyncsubtitles,代码行数:11,代码来源:TypeFactory.java

示例14: XmlRpcWriter

import org.apache.xmlrpc.common.XmlRpcStreamConfig; //导入依赖的package包/类
public XmlRpcWriter(XmlRpcStreamConfig pConfig, ContentHandler pHandler, TypeFactory pTypeFactory) {
    super(pConfig, pHandler, pTypeFactory);
    handler = pHandler;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:XmlRpcWriter.java


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