本文整理汇总了Java中org.globus.wsrf.encoding.ObjectDeserializer类的典型用法代码示例。如果您正苦于以下问题:Java ObjectDeserializer类的具体用法?Java ObjectDeserializer怎么用?Java ObjectDeserializer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectDeserializer类属于org.globus.wsrf.encoding包,在下文中一共展示了ObjectDeserializer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: discoverByFilter
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
/**
* Applies the specified predicate to the common path in the Index Service's
* Resource Properties to return registered services' EPRs that match the
* predicate.
*
* @param xpathPredicate
* predicate to apply to the "Entry" in Index Service
* @return EndpointReferenceType[] of matching services @
* @throws ResourcePropertyRetrievalException
* @throws QueryInvalidException
* @throws RemoteResourcePropertyRetrievalException
*/
protected EndpointReferenceType[] discoverByFilter(String xpathPredicate)
throws RemoteResourcePropertyRetrievalException, QueryInvalidException, ResourcePropertyRetrievalException {
EndpointReferenceType[] results = null;
// query the service and deser the results
MessageElement[] elements = ResourcePropertyHelper.queryResourceProperties(this.indexEPR,
translateXPath(xpathPredicate));
Object[] objects = null;
try {
objects = ObjectDeserializer.toObject(elements, EndpointReferenceType.class);
} catch (DeserializationException e) {
throw new ResourcePropertyRetrievalException("Unable to deserialize results to EPRs!", e);
}
// if we got results, cast them into what we are expected to return
if (objects != null) {
results = new EndpointReferenceType[objects.length];
System.arraycopy(objects, 0, results, 0, objects.length);
}
return results;
}
示例2: enumerateExperiments
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
private void enumerateExperiments() throws RemoteException, DeserializationException {
ExperimentSearchCriteria experimentSearchCriteria = new ExperimentSearchCriteria();
startTime = System.currentTimeMillis();
EnumerationResponseContainer expEnum = client.enumerateExperiments(experimentSearchCriteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(expEnum, CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
IterationConstraints ic = new IterationConstraints(5, -1, null);
iter.setIterationConstraints(ic);
int numExperimentsFound = 0;
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
Experiment experiment = (Experiment) ObjectDeserializer.toObject(elem, Experiment.class);
System.out.print(experiment.getTitle() + " ");
numExperimentsFound ++;
}
} catch (NoSuchElementException e) {
break;
}
}
totalTime = System.currentTimeMillis() - startTime;
System.out.println("End of experiment enumeration.");
System.out.println("Found " + numExperimentsFound + " experiments in " + totalTime + " ms.");
}
示例3: enumerateBiomaterials
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<Biomaterial> enumerateBiomaterials(String api,
BiomaterialSearchCriteria criteria) throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateBiomaterials(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<Biomaterial> resultsList = new ArrayList<Biomaterial>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
Biomaterial biomaterial = (Biomaterial) ObjectDeserializer.toObject(elem, Biomaterial.class);
resultsList.add(biomaterial);
}
} catch (NoSuchElementException e) {
break;
}
}
return resultsList;
}
示例4: enumerateBiomaterialsByKeyword
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<Biomaterial> enumerateBiomaterialsByKeyword(String api,
BiomaterialKeywordSearchCriteria criteria) throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateBiomaterialsByKeyword(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<Biomaterial> resultsList = new ArrayList<Biomaterial>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
Biomaterial biomaterial = (Biomaterial) ObjectDeserializer.toObject(elem, Biomaterial.class);
resultsList.add(biomaterial);
}
} catch (NoSuchElementException e) {
//break;
}
}
return resultsList;
}
示例5: enumerateByExample
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<? extends AbstractCaArrayEntity> enumerateByExample(String api,
ExampleSearchCriteria<? extends AbstractCaArrayEntity> criteria, Class<? extends AbstractCaArrayEntity> clazz)
throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateByExample(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<AbstractCaArrayEntity> resultsList = new ArrayList<AbstractCaArrayEntity>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
AbstractCaArrayEntity entity = (AbstractCaArrayEntity) ObjectDeserializer.toObject(elem, clazz);
resultsList.add(entity);
}
} catch (NoSuchElementException e) {
//break;
}
}
return resultsList;
}
示例6: enumerateExperiments
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<Experiment> enumerateExperiments(String api,
ExperimentSearchCriteria criteria) throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateExperiments(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<Experiment> resultsList = new ArrayList<Experiment>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
Experiment entity = (Experiment) ObjectDeserializer.toObject(elem, Experiment.class);
resultsList.add(entity);
}
} catch (NoSuchElementException e) {
//break;
}
}
return resultsList;
}
示例7: enumerateExperimentsByKeyword
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<Experiment> enumerateExperimentsByKeyword(String api,
KeywordSearchCriteria criteria) throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateExperimentsByKeyword(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<Experiment> resultsList = new ArrayList<Experiment>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
Experiment entity = (Experiment) ObjectDeserializer.toObject(elem, Experiment.class);
resultsList.add(entity);
}
} catch (NoSuchElementException e) {
//break;
}
}
return resultsList;
}
示例8: enumerateFiles
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<File> enumerateFiles(String api, FileSearchCriteria criteria)
throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateFiles(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<File> resultsList = new ArrayList<File>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
File entity = (File) ObjectDeserializer.toObject(elem, File.class);
resultsList.add(entity);
}
} catch (NoSuchElementException e) {
//break;
}
}
return resultsList;
}
示例9: enumerateHybridizations
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public List<Hybridization> enumerateHybridizations(String api,
HybridizationSearchCriteria criteria) throws Exception
{
EnumerationResponseContainer results = gridClient.enumerateHybridizations(criteria);
ClientEnumIterator iter = EnumerationResponseHelper.createClientIterator(results,CaArraySvc_v1_0Client.class
.getResourceAsStream("client-config.wsdd"));
List<Hybridization> resultsList = new ArrayList<Hybridization>();
while (iter.hasNext()) {
try {
SOAPElement elem = (SOAPElement) iter.next();
if (elem != null) {
Hybridization entity = (Hybridization) ObjectDeserializer.toObject(elem, Hybridization.class);
resultsList.add(entity);
}
} catch (NoSuchElementException e) {
break;
}
}
return resultsList;
}
示例10: wrapScanFeatures
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
private ScanFeaturesType[] wrapScanFeatures(String[] scanFeaturesXml)
throws ParserConfigurationException, SAXException, IOException, DeserializationException
{
ScanFeaturesType[] ret = new ScanFeaturesType[scanFeaturesXml.length];
for (int i = 0; i < ret.length; i++) {
ByteArrayInputStream is = new ByteArrayInputStream(scanFeaturesXml[i].getBytes());
org.w3c.dom.Document doc = XMLUtils.newDocument(is);
//System.out.println(scanFeaturesXml[i]);
ret[i] = (ScanFeaturesType) ObjectDeserializer.toObject(doc.getDocumentElement(), ScanFeaturesType.class);
}
return ret;
}
示例11: setUp
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
super.setUp();
org.w3c.dom.Document doc = null;
InputStream is = null;
is = getClass().getResourceAsStream(SERVICE1_EPR_RESOURCE);
assertNotNull(is);
doc = XmlUtils.newDocument(is);
this.service1EPR = (EndpointReferenceType) ObjectDeserializer.toObject(doc.getDocumentElement(),
EndpointReferenceType.class);
assertNotNull(this.service1EPR);
is = getClass().getResourceAsStream(SERVICE2_EPR_RESOURCE);
assertNotNull(is);
doc = XmlUtils.newDocument(is);
this.service2EPR = (EndpointReferenceType) ObjectDeserializer.toObject(doc.getDocumentElement(),
EndpointReferenceType.class);
assertNotNull(this.service2EPR);
is = getClass().getResourceAsStream(SERVICE3_EPR_RESOURCE);
assertNotNull(is);
doc = XmlUtils.newDocument(is);
this.service3EPR = (EndpointReferenceType) ObjectDeserializer.toObject(doc.getDocumentElement(),
EndpointReferenceType.class);
assertNotNull(this.service3EPR);
is = getClass().getResourceAsStream(SERVICE4_EPR_RESOURCE);
assertNotNull(is);
doc = XmlUtils.newDocument(is);
this.service4EPR = (EndpointReferenceType) ObjectDeserializer.toObject(doc.getDocumentElement(),
EndpointReferenceType.class);
assertNotNull(this.service4EPR);
}
示例12: getQuery
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
private CQLQuery getQuery(String filename) {
try {
System.out.println("Validating CQL " + filename + " against domain model");
InputSource queryInput = new InputSource(new FileReader(filename));
CQLQuery query = (CQLQuery) ObjectDeserializer.deserialize(queryInput, CQLQuery.class);
return query;
} catch (Exception ex) {
ex.printStackTrace();
fail(ex.getMessage());
}
return null;
}
示例13: checkForUpdates
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
protected void checkForUpdates() throws MalformedURLException, IOException, Exception {
URL url = null;
url = new URL(getUpdateSiteTextField().getText() + "/software.xml");
URLConnection connection = url.openConnection();
InputStream stream = connection.getInputStream();
org.w3c.dom.Document doc = XMLUtils.newDocument(stream);
software = (SoftwareType) ObjectDeserializer.toObject(doc.getDocumentElement(), SoftwareType.class);
stream.close();
this.getUpdatesTree().update(software);
}
示例14: loadConfiguration
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
private Configuration loadConfiguration() throws Exception {
InputStream inputStream = this.getClass().getResourceAsStream("/configuration.xml");
org.w3c.dom.Document doc = XMLUtils.newDocument(inputStream);
Object obj = ObjectDeserializer.toObject(doc.getDocumentElement(), Configuration.class);
inputStream.close();
return Configuration.class.cast(obj);
}
示例15: deserializeDocument
import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public static <T> T deserializeDocument(String fileName, Class<T> objectType) throws Exception {
InputStream inputStream = null;
inputStream = new FileInputStream(fileName);
org.w3c.dom.Document doc = XMLUtils.newDocument(inputStream);
Object obj = ObjectDeserializer.toObject(doc.getDocumentElement(), objectType);
inputStream.close();
return objectType.cast(obj);
}