本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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();
}
}
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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();
}