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

Java ObjectDeserializer类代码示例

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

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



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

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:36,代码来源:DiscoveryClient.java


示例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.");
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:26,代码来源:LookUpEntities.java


示例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;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:22,代码来源:GridApiFacade.java


示例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;
}
 
开发者ID:NCIP,项目名称:caarray,代码行数:22,代码来源:GridApiFacade.java


示例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;

}
 
开发者ID:NCIP,项目名称:caarray,代码行数:24,代码来源:GridApiFacade.java


示例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;

}
 
开发者ID:NCIP,项目名称:caarray,代码行数:23,代码来源:GridApiFacade.java


示例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;

}
 
开发者ID:NCIP,项目名称:caarray,代码行数:23,代码来源:GridApiFacade.java


示例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;

}
 
开发者ID:NCIP,项目名称:caarray,代码行数:23,代码来源:GridApiFacade.java


示例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;

}
 
开发者ID:NCIP,项目名称:caarray,代码行数:23,代码来源:GridApiFacade.java


示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-general,代码行数:13,代码来源:RProteomicsImpl.java


示例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);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:35,代码来源:DiscoveryClientTestCase.java


示例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;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:13,代码来源:ValidDomainTestCase.java


示例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);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:11,代码来源:CheckForUpdatesStep.java


示例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);

}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:10,代码来源:TargetGridsManager.java


示例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);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:10,代码来源:Utils.java


示例16: retrieve

import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public Object retrieve(IdentifierData ivs) throws Exception {

        validateKeys(ivs);

        KeyData eprKD = ivs.getValues("EPR");
        KeyData cqlKD = ivs.getValues("CQL");
                
        String[] eprStrs = null;
        String[] cqlStrs = null;
        
        if (eprKD != null) {
        	eprStrs = eprKD.getValuesAsArray();
        }
        
        if (cqlKD != null) {
        	cqlStrs = cqlKD.getValuesAsArray();
        }

        if (eprStrs == null || eprStrs.length == 0 || cqlStrs == null || cqlStrs.length == 0) {
            System.out.println("No data available to perform CQL resolution");
            return null;
        }

        //
        // Deserialize EPR
        //
        System.out.println("Going to deserialize EPR={" + eprStrs[0] + "}");

        StringBufferInputStream fis = new StringBufferInputStream(eprStrs[0]);
        EndpointReferenceType endpoint = (EndpointReferenceType) ObjectDeserializer.deserialize(new InputSource(fis),
            EndpointReferenceType.class);

        //
        // Deserialize query
        //
        System.out.println("Going to deserialize CQL={" + cqlStrs[0] + "}");

        gov.nih.nci.cagrid.cqlquery.CQLQuery query = (gov.nih.nci.cagrid.cqlquery.CQLQuery) gov.nih.nci.cagrid.common.Utils
            .deserializeObject(new java.io.StringReader(cqlStrs[0]), gov.nih.nci.cagrid.cqlquery.CQLQuery.class);

        String endpointUrl = endpoint.getAddress().toString();
        String portName = endpoint.getPortType().getLocalPart();

        return query(query, endpointUrl, portName);
    }
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:46,代码来源:CQLRetriever.java


示例17: introduceUptodate

import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public static boolean introduceUptodate() throws Exception {

        URL url = null;
        url = new URL(ConfigurationUtil.getIntroducePortalConfiguration().getUpdateSiteURL() + "/software.xml");
        URLConnection connection = url.openConnection();
        InputStream stream = connection.getInputStream();
        org.w3c.dom.Document doc = XMLUtils.newDocument(stream);
        SoftwareType software = (SoftwareType) ObjectDeserializer
            .toObject(doc.getDocumentElement(), SoftwareType.class);

        // check introduce is uptodate
        if (software.getIntroduce() != null) {
            for (int i = 0; i < software.getIntroduce().length; i++) {

                IntroduceType type = software.getIntroduce(i);
                if (!SoftwareUpdateTools.isOlderVersion(IntroducePropertiesManager.getIntroduceVersion(), type
                    .getVersion())) {
                    if (IntroducePropertiesManager.getIntroduceVersion().equals(type.getVersion())) {
                        if (type.getIntroduceRev() != null && type.getIntroduceRev().length > 0) {
                            IntroduceRevType latestRev = type.getIntroduceRev(0);
                            for (int revi = 0; i < type.getIntroduceRev().length; revi++) {
                                IntroduceRevType tryRev = type.getIntroduceRev(revi);

                                if (tryRev.getPatchVersion() >= latestRev.getPatchVersion()) {
                                    latestRev = tryRev;
                                }
                            }

                            int currentRev = Integer.parseInt(IntroducePropertiesManager.getIntroducePatchVersion());

                            if (currentRev < latestRev.getPatchVersion()) {
                                // an introduce patch exists
                                return false;
                            }
                        }
                    } else {
                        // a new version of introduce exists
                        return false;
                    }
                }
            }
        }
        // nothing new that pertains to introduce
        return true;
    }
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:46,代码来源:UptodateChecker.java


示例18: deserializeInputStream

import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
private static <T> T deserializeInputStream(InputStream inputStream, Class<T> objectType) throws Exception {
    org.w3c.dom.Document doc = XMLUtils.newDocument(inputStream);
    Object obj = ObjectDeserializer.toObject(doc.getDocumentElement(), objectType);
    return objectType.cast(obj);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:GAARDSApplication.java


示例19: deserializeObject

import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
public static <T> T deserializeObject(Reader xmlReader, Class<T> clazz) throws Exception {
    org.w3c.dom.Document doc = XMLUtils.newDocument(new InputSource(xmlReader));
    Object obj = ObjectDeserializer.toObject(doc.getDocumentElement(), clazz);
    return clazz.cast(obj);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:Utils.java


示例20: deserializeCQLQuery

import org.globus.wsrf.encoding.ObjectDeserializer; //导入依赖的package包/类
/**
 * Create an instance of CQLQuery from the specified input stream. The stream
 * must contain an XML representation of the CQLQuery. If the reader is
 * null, an IllegalArgumentException will be thrown.
 * 
 * @param xmlStream
 * @return an instance of CQLQuery from the specified inputstream.
 * @throws Exception
 *             on null argument or deserialization failure
 */
public static CQLQuery deserializeCQLQuery(InputStream xmlStream) throws Exception {
	if (xmlStream == null) {
		throw new IllegalArgumentException("Null is not a valid argument");
	}

	org.w3c.dom.Document doc = XMLUtils.newDocument(xmlStream);
	return (CQLQuery) ObjectDeserializer.toObject(doc.getDocumentElement(), CQLQuery.class);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:SerializationUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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