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


Java AnyHelper类代码示例

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


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

示例1: run

import org.globus.wsrf.utils.AnyHelper; //导入依赖的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.utils.AnyHelper; //导入依赖的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.utils.AnyHelper; //导入依赖的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.utils.AnyHelper; //导入依赖的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: createSubscriptionListener

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
private SubscriptionListener createSubscriptionListener(
    final FederatedQueryResultsRetrievalClient resultsClient, final InfoHolder info) {
    SubscriptionListener listener = new SubscriptionListener() {
        public void subscriptionValueChanged(ResourcePropertyValueChangeNotificationType notification) {
            try {
                String newMetadataDocument = AnyHelper.toSingleString(notification.getNewValue().get_any());
                FederatedQueryExecutionStatus status = Utils.deserializeObject(
                    new StringReader(newMetadataDocument), FederatedQueryExecutionStatus.class);
                StringWriter writer = new StringWriter();
                Utils.serializeObject(status, FederatedQueryResultsConstants.FEDERATEDQUERYEXECUTIONSTATUS, writer);
                LOG.debug("GOT NOTIFICATION:");
                LOG.debug(writer.getBuffer().toString());
                if ((info.success == null || !info.success.booleanValue()) && ProcessingStatus.Complete.equals(status.getCurrentStatus())) {
                    enumerateAndVerify(resultsClient);
                    LOG.debug("SETTING SUCCESS STATUS TO TRUE");
                    info.success = Boolean.TRUE;
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                info.success = Boolean.FALSE;
                info.exception = ex;
            }
        }
    };
    return listener;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:27,代码来源:Dcql2EnumerationQueryExecutionStep.java

示例6: createSubscriptionListener

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
private SubscriptionListener createSubscriptionListener(
    final FederatedQueryResultsClient resultsClient, final InfoHolder info) {
    SubscriptionListener listener = new SubscriptionListener() {
        public void subscriptionValueChanged(ResourcePropertyValueChangeNotificationType notification) {
            try {
                String newMetadataDocument = AnyHelper.toSingleString(notification.getNewValue().get_any());
                FederatedQueryExecutionStatus status = (FederatedQueryExecutionStatus) Utils.deserializeObject(
                    new StringReader(newMetadataDocument), FederatedQueryExecutionStatus.class);
                StringWriter writer = new StringWriter();
                Utils.serializeObject(status, FederatedQueryResultsConstants.FEDERATEDQUERYEXECUTIONSTATUS, writer);
                LOG.debug("GOT NOTIFICATION:");
                LOG.debug(writer.getBuffer().toString());
                if ((info.success == null || !info.success.booleanValue()) && ProcessingStatus.Complete.equals(status.getCurrentStatus())) {
                    enumerateAndVerify(resultsClient);
                    LOG.debug("SETTING SUCCESS STATUS TO TRUE");
                    info.success = Boolean.TRUE;
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                info.success = Boolean.FALSE;
                info.exception = ex;
            }
        }
    };
    return listener;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:27,代码来源:EnumerationQueryExecutionStep.java

示例7: debugPrintResource

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
/**
 * @param entryEPR
 */
private void debugPrintResource(String header, EndpointReferenceType entryEPR) {
    if (LOG.isDebugEnabled()) {
        try {
            LOG.debug(header + " " + printEPR(entryEPR));
            MessageElement[] rps = ResourcePropertyHelper.queryResourceProperties(entryEPR, "/");
            StringBuffer sb = new StringBuffer("Resource Properties of entry: ");
            if (rps != null) {
                for (MessageElement elm : rps) {
                    sb.append("\n" + AnyHelper.toString(elm));
                }

            } else {
                sb.append("none");
            }
            LOG.debug(sb.toString());
        } catch (Exception e) {
            LOG.debug("Problem querying RPs for debug purposes:", e);
        }
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:24,代码来源:TerminationClient.java

示例8: createStackFault

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
private static BaseFaultType createStackFault(String message,
                                              String stackTrace) {
    BaseFaultType stackFault = new BaseFaultType();
    BaseFaultTypeErrorCode errorCode = new BaseFaultTypeErrorCode();
    errorCode.setDialect(STACK_TRACE);
    errorCode.set_any(AnyHelper.toText(stackTrace));
    stackFault.setErrorCode(errorCode);
    
    if (message != null && message.length() > 0) {
        BaseFaultTypeDescription [] desc = new BaseFaultTypeDescription[1];
        desc[0] = new BaseFaultTypeDescription(message);
        stackFault.setDescription(desc);
    }
    
    stackFault.setTimestamp(Calendar.getInstance());
    
    return stackFault;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:FaultHelper.java

示例9: createSubscriptionListener

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
private SubscriptionListener createSubscriptionListener(
    final FederatedQueryResultsClient resultsClient, final InfoHolder info) {
    SubscriptionListener listener = new SubscriptionListener() {
        private boolean completeDetected = false;
        
        public void subscriptionValueChanged(ResourcePropertyValueChangeNotificationType notification) {
            try {
                String newMetadataDocument = AnyHelper.toSingleString(notification.getNewValue().get_any());
                FederatedQueryExecutionStatus status = Utils.deserializeObject(
                    new StringReader(newMetadataDocument), FederatedQueryExecutionStatus.class);
                StringWriter writer = new StringWriter();
                Utils.serializeObject(status, FederatedQueryResultsConstants.FEDERATEDQUERYEXECUTIONSTATUS, writer);
                if (LOG.isDebugEnabled())  {
                    LOG.debug("GOT NOTIFICATION:");
                    LOG.debug(writer.getBuffer().toString());
                }
                if (!completeDetected && ProcessingStatus.Complete.equals(status.getCurrentStatus())) {
                    completeDetected = true;
                    LOG.debug("EXECUTING TRANSFER AND VERIFY PROCESS");
                    transferAndVerify(resultsClient);
                    LOG.debug("SETTING SUCCESS STATUS TO TRUE");
                    info.success = Boolean.TRUE;
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                info.success = Boolean.FALSE;
                info.exception = ex;
            }
        }
    };
    return listener;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:33,代码来源:TransferQueryExecutionStep.java

示例10: createSubscriptionListener

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
private SubscriptionListener createSubscriptionListener(
    final FederatedQueryResultsRetrievalClient resultsClient, final InfoHolder info) {
    SubscriptionListener listener = new SubscriptionListener() {
        private boolean completeDetected = false;
        
        public void subscriptionValueChanged(ResourcePropertyValueChangeNotificationType notification) {
            try {
                String newMetadataDocument = AnyHelper.toSingleString(notification.getNewValue().get_any());
                FederatedQueryExecutionStatus status = Utils.deserializeObject(
                    new StringReader(newMetadataDocument), FederatedQueryExecutionStatus.class);
                StringWriter writer = new StringWriter();
                Utils.serializeObject(status, FederatedQueryResultsConstants.FEDERATEDQUERYEXECUTIONSTATUS, writer);
                if (LOG.isDebugEnabled())  {
                    LOG.debug("GOT NOTIFICATION:");
                    LOG.debug(writer.getBuffer().toString());
                }
                if (!completeDetected && ProcessingStatus.Complete.equals(status.getCurrentStatus())) {
                    completeDetected = true;
                    LOG.debug("EXECUTING TRANSFER AND VERIFY PROCESS");
                    transferAndVerify(resultsClient);
                    LOG.debug("SETTING SUCCESS STATUS TO TRUE");
                    info.success = Boolean.TRUE;
                }
            } catch (Exception ex) {
                ex.printStackTrace();
                info.success = Boolean.FALSE;
                info.exception = ex;
            }
        }
    };
    return listener;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:33,代码来源:Dcql2TransferQueryExecutionStep.java

示例11: getStackTrace

import org.globus.wsrf.utils.AnyHelper; //导入依赖的package包/类
/**
 * Gets stack trace of the fault. Note, this stack trace only contains
 * information sent from server. It does not contain client stack 
 * trace information.
 *
 * @return stack trace of the fault. It includes any chained faults.
 */
public String getStackTrace() {
    StringBuffer buf = new StringBuffer();
    buf.append(this.fault.getClass().getName());
    String desc = getDescriptionAsString();
    if (desc != null) {
        buf.append(": ").append(desc);
    }
    if (this.fault.getTimestamp() != null) {
        buf.append(LS).append(i18n.getMessage("timestamp"));
        buf.append(this.fault.getTimestamp().getTime().toString());
    }
    if (this.fault.getOriginator() != null) {
        buf.append(LS).append(i18n.getMessage("originator"));
        buf.append(this.fault.getOriginator().toString());
    }
    BaseFaultType [] cause = this.fault.getFaultCause();
    BaseFaultTypeErrorCode errorCode = null;
    if (cause != null) {
        FaultHelper helper = null;
        for (int i=0;i<cause.length;i++) {
            helper = new FaultHelper(cause[i], false);
            errorCode = cause[i].getErrorCode();
            if (errorCode != null && 
                STACK_TRACE.equals(errorCode.getDialect())) {
                buf.append(LS);
                try {
                    buf.append(AnyHelper.toSingleString(
                                          errorCode.get_any()));
                } catch (Exception e) {
                    // ?
                }
                continue;
            }
            buf.append(LS).append(i18n.getMessage("causedBy01"));
            buf.append(helper.getStackTrace());
        }
    }
    return buf.toString();
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:47,代码来源:FaultHelper.java


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