本文整理汇总了Java中gov.nih.nci.system.applicationservice.ApplicationService类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationService类的具体用法?Java ApplicationService怎么用?Java ApplicationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationService类属于gov.nih.nci.system.applicationservice包,在下文中一共展示了ApplicationService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testSearch
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public void testSearch() throws Exception
{
ApplicationService appService = getApplicationService();
Collection<Class> classList = getClasses();
for(Class klass:classList)
{
if (!Modifier.isAbstract(klass.getModifiers())){
Object o = klass.newInstance();
System.out.println("Searching for "+klass.getName());
try
{
Collection results = appService.search(klass, o);
for(Object obj : results)
{
printObject(obj, klass);
break;
}
}catch(Exception e)
{
System.out.println(">>>"+e.getMessage());
}
}
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:26,代码来源:TestClient.java
示例2: queryCoreService
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
protected List<?> queryCoreService(CQLQuery query)
throws QueryProcessingException {
// get the caCORE application service
ApplicationService service = getApplicationService();
// generate the HQL to perform the query
// new CQL2HQL process handles query modifiers at HQL level
ParameterizedHqlQuery parameterizedHql = cqlTranslator.convertToHql(query);
LOG.debug("Executing HQL:\n" + parameterizedHql);
// process the query
HQLCriteria hqlCriteria = new HQLCriteria(parameterizedHql.getHql(), parameterizedHql.getParameters());
List<?> targetObjects = null;
try {
targetObjects = service.query(hqlCriteria);
} catch (Exception ex) {
String message = "Error querying caCORE Application Service: " + ex.getMessage();
throw new QueryProcessingException(message, ex);
}
return targetObjects;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:22,代码来源:SDK4QueryProcessor.java
示例3: convertClass
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
private static void convertClass(ApplicationService appService, String projectShortName, String projectVersion,
gov.nih.nci.cagrid.metadata.common.UMLClass result, UMLClassMetadata classMetadata) throws ApplicationException {
if (classMetadata == null || result == null) {
return;
}
result.setClassName(classMetadata.getName());
result.setDescription(classMetadata.getDescription());
if (result.getDescription() == null) {
result.setDescription("");
}
result.setId(classMetadata.getId());
result.setPackageName(CaDSRUtils.getPackageName(classMetadata));
result.setProjectName(projectShortName);
result.setProjectVersion(projectVersion);
UMLAttribute[] attributes = createClassAttributes(appService, classMetadata);
UMLClassUmlAttributeCollection attCol = new UMLClassUmlAttributeCollection();
attCol.setUMLAttribute(attributes);
result.setUmlAttributeCollection(attCol);
gov.nih.nci.cagrid.metadata.common.SemanticMetadata[] smArray = semanticMetadataCollectionToArray(classMetadata
.getSemanticMetadataCollection());
result.setSemanticMetadata(smArray);
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:27,代码来源:CaDSRUtils.java
示例4: generateDomainModelForClassesWithExcludes
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public DomainModel generateDomainModelForClassesWithExcludes(UMLProjectIdentifer umlProjectIdentifer,
Collection<String> fullyQualifiedClassNames, Collection<UMLAssociationExclude> umlAssociationExclude)
throws InvalidUMLProjectIndentifier, MMSGeneralException {
ApplicationService applicationService = getApplicationServiceForUMLProjectIdentifier(umlProjectIdentifer);
DomainModelBuilder builder = new DomainModelBuilder(applicationService);
try {
String classes[] = new String[fullyQualifiedClassNames.size()];
UMLAssociationExclude excludes[] = new UMLAssociationExclude[umlAssociationExclude.size()];
return builder.createDomainModelForClassesWithExcludes(
createProjectPrototypeFromIdentifier(umlProjectIdentifer), fullyQualifiedClassNames.toArray(classes),
umlAssociationExclude.toArray(excludes));
} catch (DomainModelGenerationException e) {
throw new MMSGeneralException("Problem from remote caDSR:" + e.getMessage(), e);
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:19,代码来源:CaDSRMMSImpl.java
示例5: getApplicationServiceForUMLProjectIdentifier
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
private ApplicationService getApplicationServiceForUMLProjectIdentifier(UMLProjectIdentifer umlProjectIdentifer)
throws InvalidUMLProjectIndentifier, MMSGeneralException {
SourceDescriptor desc = getSourceDescriptorForUMLProjectIdentifier(umlProjectIdentifer);
if (desc == null) {
InvalidUMLProjectIndentifier fault = new InvalidUMLProjectIndentifier();
FaultHelper helper = new FaultHelper(fault);
helper
.setDescription("The source ("
+ umlProjectIdentifer.getSourceIdentifier()
+ ") specified in the UMLProjectIdentifier is not supported. View the ModelSourceMetadata for supported sources.");
throw (InvalidUMLProjectIndentifier) helper.getFault();
}
return getApplicationService(desc.getIdentifier());
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:17,代码来源:CaDSRMMSImpl.java
示例6: getUMLClassForQName
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
/**
* @param qname
* @return The UML Class matching the QName
* @throws CaDSRGeneralException
*/
protected UMLClass getUMLClassForQName(QName qname) throws CaDSRGeneralException {
// look up the UMLClassMetadata we are looking for, based on the QName
UMLClassMetadata classMetadata = getUMLClassMetadataForQName(qname);
if (classMetadata == null) {
return null;
}
UMLClass result = null;
try {
String shortName = classMetadata.getProject().getShortName();
String version = classMetadata.getProject().getVersion();
ApplicationService cadsr = defaultcaDSR;
QualifiedProject proj = uri2ServiceMap.get(qname.getNamespaceURI());
if (proj != null) {
cadsr = proj.getSourceAppServ();
}
result = CaDSRUtils.convertClassToUMLClass(cadsr, shortName, version, classMetadata);
} catch (ApplicationException e) {
LOG.error("Problem converting class to metadata", e);
}
return result;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:30,代码来源:ServiceMetadataAnnotator.java
示例7: main
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public static void main(String[] args) {
try {
JFrame f = new JFrame();
f.setVisible(true);
JFileChooser fc = new JFileChooser(".");
fc.showOpenDialog(f);
File selectedFile = fc.getSelectedFile();
ServiceMetadata model = MetadataUtils.deserializeServiceMetadata(new FileReader(selectedFile));
ApplicationService appService = ApplicationServiceProvider
.getApplicationServiceFromUrl("http://cadsrapi-prod2.nci.nih.gov/cadsrapi40/");
ServiceMetadataAnnotator anno = new ServiceMetadataAnnotator(null, appService);
anno.annotateServiceMetadata(model);
File result = new File(".", selectedFile.getName() + "_annotated");
MetadataUtils.serializeServiceMetadata(model, new FileWriter(result));
System.exit(0);
} catch (Exception e) {
e.printStackTrace();
System.exit(-1);
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:25,代码来源:ServiceMetadataAnnotator.java
示例8: main
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public static void main(String[] args) {
try {
ApplicationService appService = ApplicationServiceProvider
.getApplicationServiceFromUrl("http://cadsrapi.nci.nih.gov/cadsrapi40/");
List rList = appService.search(Project.class, new Project());
for (Iterator resultsIterator = rList.iterator(); resultsIterator.hasNext();) {
Project project = (Project) resultsIterator.next();
System.out.println(project.getShortName());
System.out.println(project.getVersion());
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:17,代码来源:ApplicationServiceExample.java
示例9: getTestContext
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
protected Context getTestContext() throws Exception {
if (testContext == null) {
try {
ApplicationService caCoreService = getCaCoreAPIService();
Context context = new Context();
UMLBrowserParams params = UMLBrowserParams.getInstance();
context.setName(params.getTestContext());
List contexts = caCoreService.search(Context.class,context);
if (contexts.size()>0) {
testContext = (Context)contexts.get(0);
}
}
catch (Exception e) {
log.error("Error getting test context.",e);
throw e;
}
}
return testContext;
}
开发者ID:NCIP,项目名称:cadsr-uml-model-browser,代码行数:21,代码来源:UMLBrowserQueryServiceImpl.java
示例10: getTrainingContext
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
protected Context getTrainingContext() throws Exception {
if (trainingContext == null) {
try {
ApplicationService caCoreService = getCaCoreAPIService();
Context context = new Context();
UMLBrowserParams params = UMLBrowserParams.getInstance();
context.setName(params.getTrainingContext());
List contexts = caCoreService.search(Context.class,context);
if (contexts.size()>0) {
trainingContext = (Context)contexts.get(0);
}
}
catch (Exception e) {
log.error("Error getting test context.",e);
throw e;
}
}
return trainingContext;
}
开发者ID:NCIP,项目名称:cadsr-uml-model-browser,代码行数:20,代码来源:UMLBrowserQueryServiceImpl.java
示例11: getProjectForContext
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public List<Project> getProjectForContext(Context context) throws Exception{
ApplicationService caCoreService = getCaCoreAPIService();
DetachedCriteria projectCriteria =
DetachedCriteria.forClass(Project.class);
projectCriteria.addOrder(Order.asc("longName").ignoreCase());
if (context != null && context.getId().length() >0) {
DetachedCriteria csCri = projectCriteria.createCriteria("classificationScheme");
csCri.add(Expression.eq("latestVersionIndicator", "Yes"));
DetachedCriteria contextCri= csCri.createCriteria("context");
contextCri.add(Expression.eq("id", context.getId()));
}
List results = caCoreService.query(projectCriteria);
//caCoreService.query(projectCriteria, Project.class.getName());;
return results;
}
开发者ID:NCIP,项目名称:cadsr-uml-model-browser,代码行数:17,代码来源:UMLBrowserQueryServiceImpl.java
示例12: convertClass
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
private static void convertClass(ApplicationService appService, String projectShortName, String projectVersion,
gov.nih.nci.cagrid.metadata.common.UMLClass result, UMLClassMetadata classMetadata) throws ApplicationException {
if (classMetadata == null || result == null) {
return;
}
result.setClassName(classMetadata.getName());
result.setDescription(classMetadata.getDescription());
if (result.getDescription() == null) {
result.setDescription("");
}
result.setId(classMetadata.getId());
result.setPackageName(CaDSRUtils.getPackageName(classMetadata));
result.setProjectName(projectShortName);
result.setProjectVersion(projectVersion);
UMLAttribute[] attributes = createClassAttributes(appService, classMetadata);
UmlAttributeCollection attCol = new UmlAttributeCollection();
attCol.getUMLAttribute().addAll(Arrays.asList(attributes));
result.setUmlAttributeCollection(attCol);
gov.nih.nci.cagrid.metadata.common.SemanticMetadata[] smArray = semanticMetadataCollectionToArray(classMetadata
.getSemanticMetadataCollection());
result.getSemanticMetadata().addAll(Arrays.asList(smArray));
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:27,代码来源:CaDSRUtils.java
示例13: getApplicationService
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
private ApplicationService getApplicationService(String sourceID) throws MMSGeneralException {
ApplicationService appService = null;
String url = this.sourceToURLMap.get(sourceID);
if (url == null) {
throw new MMSGeneralException("Unable to locate appropriate caDSR service for specified source ("
+ sourceID + ")");
}
try {
System.out.println("GETTING APPLICATION SERVICE FOR: " + url);
appService = ApplicationServiceProvider.getApplicationServiceFromUrl(this.ctx,url);
System.out.println(" FOUND APPLICATION SERVICE");
} catch (Exception e) {
throw new MMSGeneralException("Problem loading caDSR ApplicationService", e);
}
return appService;
}
开发者ID:NCIP,项目名称:cagrid2,代码行数:18,代码来源:CaDSRMMSImpl.java
示例14: testSearch
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public void testSearch() throws Exception
{
//Application Service retrieval for secured system
//ApplicationService appService = ApplicationServiceProvider.getApplicationService("userId","password");
ApplicationService appService = ApplicationServiceProvider.getApplicationService();
Collection<Class> classList = getClasses();
for(Class klass:classList)
{
Object o = klass.newInstance();
System.out.println("Searching for "+klass.getName());
try
{
Collection results = appService.search(klass, o);
for(Object obj : results)
{
printObject(obj, klass);
break;
}
}catch(Exception e)
{
System.out.println(">>>"+e.getMessage());
}
}
}
开发者ID:NCIP,项目名称:digital-model-repository,代码行数:26,代码来源:TestClient.java
示例15: retrieveCaDsrApplicationService
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public ApplicationService retrieveCaDsrApplicationService(String caDsrUrl) throws ConnectionException {
try {
return ApplicationServiceProvider.getApplicationServiceFromUrl(caDsrUrl, CADSR_SERVICE);
} catch (Exception e) {
throw new ConnectionException("Error occurred when trying to create caDSR Application Service.", e);
}
}
开发者ID:NCIP,项目名称:caintegrator,代码行数:11,代码来源:CaDSRApplicationServiceFactoryImpl.java
示例16: queryCoreService
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
protected List queryCoreService(CQLQuery query)
throws MalformedQueryException, QueryProcessingException {
// get the caCORE application service
ApplicationService service = getApplicationService();
// generate the HQL to perform the query
// new CQL2HQL process handles query modifiers at HQL level
ParameterizedHqlQuery parameterizedHql = cqlTranslator
.convertToHql(query);
LOG.debug("Executing HQL:\n" + parameterizedHql);
// process the query
HQLCriteria hqlCriteria = new HQLCriteria(parameterizedHql.getHql(),
parameterizedHql.getParameters());
List targetObjects = null;
try {
targetObjects = service.query(hqlCriteria);
// added by Sue Pan
List filteredObjects = applyPublicFilter(query.getQueryModifier(),
targetObjects);
return filteredObjects;
} catch (Exception ex) {
throw new QueryProcessingException(
"Error querying caCORE Application Service: "
+ ex.getMessage(), ex);
}
}
开发者ID:NCIP,项目名称:cananolab,代码行数:28,代码来源:PublicDataSDK4QueryProcessor.java
示例17: getService
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
protected ApplicationService getService() {
if (service == null) {
try {
service = ApplicationServiceProvider.getApplicationService();
} catch (Exception e) {
e.printStackTrace();
fail("Error initializing application service: " + e.getMessage());
}
}
return service;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:12,代码来源:AbstractLocalCqlInvocationStep.java
示例18: getSdkApplicationService
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public static synchronized ApplicationService getSdkApplicationService() throws Exception {
if (sdkService == null) {
long start = System.currentTimeMillis();
// gets the local SDK service instance
sdkService = ApplicationServiceProvider.getApplicationService();
LOG.info("Application service initialized in " + (System.currentTimeMillis() - start));
System.out.println("Application service initialized in " + (System.currentTimeMillis() - start));
}
return sdkService;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:11,代码来源:QueryTestsHelper.java
示例19: getModelUtil
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
private ModelProblemsUtil getModelUtil() throws Exception {
if (modelUtil == null) {
ApplicationService appservice = ApplicationServiceProvider
.getApplicationServiceFromUrl(getCadsrApplicationUrl());
modelUtil = new ModelProblemsUtil(appservice);
}
return modelUtil;
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:9,代码来源:CadsrModelProblemsPanel.java
示例20: reloadProjects
import gov.nih.nci.system.applicationservice.ApplicationService; //导入依赖的package包/类
public void reloadProjects() throws Exception {
getProjectsComboBox().removeAllItems();
ApplicationService appservice = ApplicationServiceProvider
.getApplicationServiceFromUrl(getCadsrApplicationUrl());
Project proj = new Project();
List projects = appservice.search(Project.class, proj);
Comparator projectSorter = new Comparator() {
public int compare(Object o1, Object o2) {
String val1 = null;
String val2 = null;
if (o1 instanceof Project) {
val1 = projectAsString((Project) o1).toLowerCase();
} else {
val1 = o1.toString();
}
if (o2 instanceof Project) {
val2 = projectAsString((Project) o2).toLowerCase();
} else {
val2 = o2.toString();
}
return val1.compareTo(val2);
}
};
Collections.sort(projects, projectSorter);
for (Object p : projects) {
getProjectsComboBox().addItem(p);
}
}
开发者ID:NCIP,项目名称:cagrid-core,代码行数:29,代码来源:CadsrModelProblemsPanel.java
注:本文中的gov.nih.nci.system.applicationservice.ApplicationService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论