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

Java ObjectSerializer类代码示例

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

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



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

示例1: run

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
public void run() throws Exception {
	FileWriter writer = null;
	this.factoryClient = new WorkflowFactoryServiceClient(url);
	WMSInputType input = createInput(null, "AnnualDemo.bpel");
	WMSOutputType output = this.factoryClient.createWorkflow(input);
	this.epr = output.getWorkflowEPR();
	writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
	writer.write( 
			ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
	this.serviceClient = new WorkflowServiceImplClient(this.epr);
	StartInputType startInput = new StartInputType();
	WorkflowInputType inputArgs = new WorkflowInputType();
	FileInputStream in = new FileInputStream("input11.xml");
	Element e2 = XmlUtils.newDocument(in).getDocumentElement();
	System.out.println(XmlUtils.toString(e2));
	MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
	inputArgs.set_any(new MessageElement[] {anyContent});
	startInput.setInputArgs(inputArgs);
	WorkflowStatusType status = this.serviceClient.start(startInput);
	//status = this.serviceClient.getStatus();
	System.out.println(status.getValue());
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:23,代码来源:AnnualDemoClient.java


示例2: run1

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
public void run1() throws Exception {
	FileWriter writer = null;
	this.factoryClient = new WorkflowFactoryServiceClient(url);
	WMSInputType input = createInput1(null, "geWorkBench.bpel");
	WMSOutputType output = this.factoryClient.createWorkflow(input);
	this.epr = output.getWorkflowEPR();
	writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
	writer.write( 
			ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
	this.serviceClient = new WorkflowServiceImplClient(this.epr);
	StartInputType startInput = new StartInputType();
	WorkflowInputType inputArgs = new WorkflowInputType();
	FileInputStream in = new FileInputStream("input10.xml");
	Element e2 = XmlUtils.newDocument(in).getDocumentElement();
	System.out.println(XmlUtils.toString(e2));
	MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
	inputArgs.set_any(new MessageElement[] {anyContent});
	startInput.setInputArgs(inputArgs);
	WorkflowStatusType status = this.serviceClient.start(startInput);
	//status = this.serviceClient.getStatus();
	System.out.println(status.getValue());
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:23,代码来源:AnnualDemoClient.java


示例3: run2

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
public void run2() throws Exception {
	FileWriter writer = null;
	this.factoryClient = new WorkflowFactoryServiceClient(url);
	WMSInputType input = createInput2(null, "genepattern.bpel");
	WMSOutputType output = this.factoryClient.createWorkflow(input);
	this.epr = output.getWorkflowEPR();
	writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
	writer.write( 
			ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
	this.serviceClient = new WorkflowServiceImplClient(this.epr);
	StartInputType startInput = new StartInputType();
	WorkflowInputType inputArgs = new WorkflowInputType();
	FileInputStream in = new FileInputStream("input3.xml");
	Element e2 = XmlUtils.newDocument(in).getDocumentElement();
	System.out.println(XmlUtils.toString(e2));
	MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
	inputArgs.set_any(new MessageElement[] {anyContent});
	startInput.setInputArgs(inputArgs);
	WorkflowStatusType status = this.serviceClient.start(startInput);
	//status = this.serviceClient.getStatus();
	System.out.println(status.getValue());
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:23,代码来源:AnnualDemoClient.java


示例4: run3

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
public void run3() throws Exception {
	FileWriter writer = null;
	this.factoryClient = new WorkflowFactoryServiceClient(url);
	WMSInputType input = createInput3(null, "PreProp.bpel");
	WMSOutputType output = this.factoryClient.createWorkflow(input);
	this.epr = output.getWorkflowEPR();
	writer = new FileWriter("workflow_" + input.getWorkflowName() + "_epr");
	writer.write( 
			ObjectSerializer.toString(epr, new QName("", "WMS_EPR")));
	this.serviceClient = new WorkflowServiceImplClient(this.epr);
	StartInputType startInput = new StartInputType();
	WorkflowInputType inputArgs = new WorkflowInputType();
	FileInputStream in = new FileInputStream("input6.xml");
	Element e2 = XmlUtils.newDocument(in).getDocumentElement();
	System.out.println(XmlUtils.toString(e2));
	MessageElement anyContent = AnyHelper.toAny(new MessageElement(e2));
	inputArgs.set_any(new MessageElement[] {anyContent});
	startInput.setInputArgs(inputArgs);
	WorkflowStatusType status = this.serviceClient.start(startInput);
	//status = this.serviceClient.getStatus();
	System.out.println(status.getValue());
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:23,代码来源:AnnualDemoClient.java


示例5: writeEprToFile

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
public static void writeEprToFile(EndpointReferenceType epr,
		String workflowName) throws Exception {
	FileWriter writer = null;
	String curDir = System.getProperty("user.dir");
	System.out.println(curDir + "/" + workflowName + ".epr");

	try {
		writer = new FileWriter(curDir + "/" + workflowName + ".epr");
		QName qName = new QName("", "TWS_EPR");

		writer.write(ObjectSerializer.toString(epr, qName));

	} finally {
		if (writer != null) {
			writer.close();
		}
	}
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:TavernaWorkflowServiceClient.java


示例6: serializeObject

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
private static String serializeObject(Object obj, MessageContext context, QName targetQName) throws Exception {
    StringWriter writer = new StringWriter();

    // derive a message element for the object
    MessageElement element = (MessageElement) ObjectSerializer.toSOAPElement(obj, targetQName);

    // create a serialization context to use the new message context
    SerializationContext serializationContext = new SerializationContext(writer, context) {
        public void serialize(QName elemQName, Attributes attributes, Object value)
        throws IOException {
            serialize(elemQName, attributes, value, null, Boolean.FALSE, null);
        }
    };
    serializationContext.setPretty(true);

    // output the message element through the serialization context
    element.output(serializationContext);
    writer.write("\n");
    writer.flush();
    return writer.getBuffer().toString();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:CQL2ResultsCreationUtil.java


示例7: serializeAttibuteResult

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
private String serializeAttibuteResult(CQLAttributeResult result) throws Exception {
    StringWriter writer = new StringWriter();
    
    // derive a message element for the object
       MessageElement element = (MessageElement) ObjectSerializer.toSOAPElement(result, CQL2_ATTRIBUTE_RESULT_QNAME);
       
       // create a serialization context to use the new message context
       SerializationContext serializationContext = new SerializationContext(writer, getMessageContext()) {
           public void serialize(QName elemQName, Attributes attributes, Object value)
               throws IOException {
               serialize(elemQName, attributes, value, null, Boolean.FALSE, null);
           }
       };
       serializationContext.setPretty(true);

       // output the message element through the serialization context
       element.output(serializationContext);
       writer.write("\n");
       writer.flush();
    return writer.getBuffer().toString();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:CQL2AttributeResultIterator.java


示例8: printEPR

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
/**
 * @param registeredEPR
 * @return The EPR as a serialized string
 * @throws SerializationException
 */
private static String printEPR(EndpointReferenceType epr) {
    if (epr == null) {
        return null;
    }
    String result = epr.getAddress().toString();
    if (epr.getProperties() != null && epr.getProperties().get_any() != null
        && epr.getProperties().get_any().length > 0) {

        try {
            result = ObjectSerializer.toString(epr, EndpointReferenceType.getTypeDesc().getXmlType());
        } catch (SerializationException e) {
            e.printStackTrace();
        }
    }
    return result;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:TerminationClient.java


示例9: next

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public IterationResult next(IterationConstraints ic) throws TimeoutException, NoSuchElementException {
    if (this.searchResultIterator == null) {
        throw new NoSuchElementException("Enumeration has been released");
    }
    
    List<SOAPElement> soapElements = new ArrayList<SOAPElement>(ic.getMaxElements());        
    try {
        for (int i = 0; i < ic.getMaxElements() && searchResultIterator.hasNext(); i++) {
            T nextResult = searchResultIterator.next();
            SOAPElement element = ObjectSerializer.toSOAPElement(nextResult, this.qname);
            soapElements.add(element);
        }
       
        return wrapUpElements(soapElements, soapElements.size() < ic.getMaxElements());
    } catch (Exception ex) {
        release();
        NoSuchElementException nse = new NoSuchElementException("Error generating elements " + ex.getMessage());
        nse.setStackTrace(ex.getStackTrace());
        throw nse;
    }
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:25,代码来源:SearchEnumIterator.java


示例10: unwrap

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
private String[] unwrap(ScanFeaturesType[] scanFeaturesXml) 
	throws SerializationException, IOException
{
	System.out.println("unwrap scaFeaturesType=" + scanFeaturesXml.length);
	QName qname = new QName("rproteomics.cabig.duke.edu/1/scanFeatures", "scanFeatures");
	String[] ret = new String[scanFeaturesXml.length];
	for (int i = 0; i < ret.length; i++) {
		StringWriter sw = new StringWriter();
		ObjectSerializer.serialize(sw, scanFeaturesXml[i], qname);
		ret[i] = sw.toString();
		sw.close();
	}
	return ret;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:15,代码来源:RProteomicsImpl.java


示例11: updateDatabase

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
protected void updateDatabase() 
{
    if (this.docID == null) {
        return;
    }
    
    this.entry.setMemberServiceEPR(this.memberEPR);
    this.entry.setServiceGroupEntryEPR(this.entryEPR);
    this.entry.setContent(this.content);        
    
    try {
        String collectionURI = this.db.getDefaultCollectionURI();

        BigIndexEntry bigEntry = new BigIndexEntry();
        bigEntry.setEntry(this.entry);
        String document =
            ObjectSerializer.toString(
                bigEntry, bigEntry.getTypeDesc().getXmlType()); 
        
        this.db.addDocument(collectionURI,
                            this.docID,
                            document,
                            true);            

        if (logger.isDebugEnabled()) {
            logger.debug("Added service group entry document with ID " + 
                         this.docID + 
                         " to database collection " + 
                         collectionURI);
        }            
    } catch (Exception e) {
        logger.error("Error processing message(s): " + e);
    }        
    
}
 
开发者ID:NCIP,项目名称:cagrid2,代码行数:36,代码来源:BigIndexEntryResource.java


示例12: serializeDocument

import org.globus.wsrf.encoding.ObjectSerializer; //导入依赖的package包/类
public static void serializeDocument(String fileName, Object object, QName qname) throws Exception {
    FileWriter fw = null;
    fw = new FileWriter(fileName);
    ObjectSerializer.serialize(fw, object, qname);
    fw.close();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:7,代码来源:Utils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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