當前位置: 首頁>>代碼示例>>Java>>正文


Java InitializationException類代碼示例

本文整理匯總了Java中gov.nih.nci.cagrid.data.InitializationException的典型用法代碼示例。如果您正苦於以下問題:Java InitializationException類的具體用法?Java InitializationException怎麽用?Java InitializationException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


InitializationException類屬於gov.nih.nci.cagrid.data包,在下文中一共展示了InitializationException類的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAnzoProperties

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
private Properties getAnzoProperties() throws InitializationException {
Properties result = new Properties() ;
Properties props = getConfiguredParameters() ;

ModelServiceProperties.setUser(result, props.getProperty(USER)) ;
ModelServiceProperties.setPassword(result, props.getProperty(PASSWORD)) ;
ModelServiceProperties.setTransportClass(result, EmbeddedModelService.class.getName()) ;

RepositoryConnectionProperties.setType(result, props.getProperty(DB_TYPE)) ;
RepositoryConnectionProperties.setUrl(result, props.getProperty(DB_URL)) ;
RepositoryConnectionProperties.setUser(result, props.getProperty(DB_USER)) ;
RepositoryConnectionProperties.setPassword(result, props.getProperty(DB_PASSWORD)) ;

RepositoryProperties.setAuthenticationProviderClass(result, DmrServiceAuthenticationProvider.class.getName()) ;
return result ;
   }
 
開發者ID:NCIP,項目名稱:digital-model-repository,代碼行數:17,代碼來源:DmrQueryProcessor.java

示例2: getQueryProcessor

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
public DmrQueryProcessor getQueryProcessor() {
if (queryProcessor == null) {
    DmrQueryProcessor result = new DmrQueryProcessor() ;
    try {
	result.initialize(
	    getDatasetService(), 
	    securityService, 
	    getWsddStream(), 
	    getClassToQnameMappings()) ;
    } catch (InitializationException e) {
	throw new RuntimeException("Exception initializing DmrQueryProcessor.", e) ;
    }
    queryProcessor = result ;
}
return queryProcessor ;
   }
 
開發者ID:NCIP,項目名稱:digital-model-repository,代碼行數:17,代碼來源:InMemoryDmrFactory.java

示例3: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
public void initialize(Properties props, InputStream wsddStream) throws InitializationException {
	// verify the values for each required property are NOT the defaults
	// if the defaults are found, that means the service properties aren't
	// getting correctly transfered into the initialization properties
	String lcPropValue = props.getProperty(PROPERTY_STARTS_WITH_LOWERCASE);
	if (lcPropValue.equals(LC_DEFAULT_VALUE)) {
		throw new InitializationException("Default value found for property " + PROPERTY_STARTS_WITH_LOWERCASE + ", service properties incorrectly transfered");
	}
	String ucPropString = props.getProperty(PROPERTY_STARTS_WITH_UPPERCASE);
	if (ucPropString.equals(UC_DEFAULT_VALUE)) {
		throw new InitializationException("Default value found for property " + PROPERTY_STARTS_WITH_UPPERCASE + ", service properties incorrectly transfered");
	}
	super.initialize(props, wsddStream);
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:15,代碼來源:TestingCQLQueryProcessor.java

示例4: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
@SuppressWarnings("unused")
public void initialize() throws InitializationException {
    // verify that if we're using grid identity login, we're also using the Local API
    if (isUseGridIdentLogin() && !isUseLocalApi()) {
        throw new InitializationException("Grid identity + CSM authentication can only be used with the local API!");
    }
    // verify we have a URL for the remote API
    if (!isUseLocalApi()) {
        try {
            new URL(getRemoteApplicationUrl());
        } catch (MalformedURLException ex) {
            throw new InitializationException("Could not determine a remote API url: " + ex.getMessage(), ex);
        }
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:16,代碼來源:SDK44CQL2QueryProcessor.java

示例5: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
public void initialize(Properties parameters, InputStream wsdd) throws InitializationException {
    super.initialize(parameters, wsdd);
    // verify that if we're using grid identity login, we're also using the Local API
    if (isUseGridIdentLogin() && !isUseLocalApi()) {
        throw new InitializationException("Grid identity + CSM authentication can only be used with the local API!");
    }
    // verify we have a URL for the remote API
    if (!isUseLocalApi()) {
        try {
            new URL(getRemoteApplicationUrl());
        } catch (MalformedURLException ex) {
            throw new InitializationException("Could not determine a remote API url: " + ex.getMessage(), ex);
        }
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:16,代碼來源:SDK42QueryProcessor.java

示例6: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
/**
 * Initialize the query processor with the properties it requires as specified
 * in the Properties instance provided by getRequiredParameters(), and values
 * populated by the user's custom entries, if any.
 * 
 * @param parameters
 * 		The parameters as configured by the user.  The set of keys must contain all
 * 		of the keys contained in the Properties object returned 
 * 		by <code>getRequiredParamters()</code>.  The values in the parameters will
 *		be either the user defined value or the default value from 
 *		<code>getRequiredParameters()</code>.
 * @param wsdd
 * 		The input stream which contains the wsdd configuration for the data service.
 * 		This stream may be important to locating type mappings for serializing and
 * 		deserializing beans.
 * @throws InitializationException
 */
public void initialize(Properties parameters, InputStream wsdd) throws InitializationException {
	Set<String> required = new HashSet<String>();
       // add all the required parameters to a set
       Enumeration requiredKeys = getRequiredParameters().keys();
       while (requiredKeys.hasMoreElements()) {
           required.add((String) requiredKeys.nextElement());
       }
       // remove all the parameters provided
       Enumeration providedKeys = parameters.keys();
       while (providedKeys.hasMoreElements()) {
           required.remove(providedKeys.nextElement().toString());
       }
       // verify the provided parameters cover the required ones
	if (required.size() != 0) {
		// some required parameters NOT specified!
		StringBuffer error = new StringBuffer();
		error.append("Required parameters for query processor ");
		error.append(getClass().getName()).append(" not specified: ");
		Iterator<String> requiredKeyIter = required.iterator();
		while (requiredKeyIter.hasNext()) {
			error.append(requiredKeyIter.next());
			if (requiredKeyIter.hasNext()) {
				error.append(", ");
			}
		}
		throw new InitializationException(error.toString());
	}
	this.params = parameters;
	this.wsddStream = wsdd;
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:48,代碼來源:CQLQueryProcessor.java

示例7: verifyProvidedParameters

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
/**
 * Verifies parameters provided from the configure method 
 * contain all required properties
 * 
 * @param parameters
 * @throws InitializationException
 */
private void verifyProvidedParameters(Properties parameters) throws InitializationException {
    Set<String> required = new HashSet<String>();
    // add all the required parameters to a set
    Enumeration<Object> requiredKeys = getRequiredParameters().keys();
    while (requiredKeys.hasMoreElements()) {
        required.add((String) requiredKeys.nextElement());
    }
    // remove all the parameters provided
    Enumeration<Object> providedKeys = parameters.keys();
    while (providedKeys.hasMoreElements()) {
        required.remove(providedKeys.nextElement().toString());
    }
    // verify the provided parameters cover the required ones
    if (required.size() != 0) {
        // some required parameters NOT specified!
        StringBuffer error = new StringBuffer();
        error.append("Required parameters for query processor ");
        error.append(getClass().getName()).append(" not specified: ");
        Iterator<String> requiredKeyIter = required.iterator();
        while (requiredKeyIter.hasNext()) {
            error.append(requiredKeyIter.next());
            if (requiredKeyIter.hasNext()) {
                error.append(", ");
            }
        }
        throw new InitializationException(error.toString());
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:36,代碼來源:CQL2QueryProcessor.java

示例8: initializeClassToQnameMappings

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
private void initializeClassToQnameMappings() throws InitializationException {
    try {
        // get the mapping file name
        String filename = ServiceConfigUtil.getClassToQnameMappingsFile();
        // String filename = "mapping.xml";
        this.classToQnameMappings = (Mappings) Utils.deserializeDocument(filename, Mappings.class);
    } catch (Exception ex) {
        String message = "Error initializing class to QName mappings: " + ex.getMessage();
        LOG.error(message, ex);
        throw new InitializationException(message, ex);
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:13,代碼來源:SDK4QueryProcessor.java

示例9: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
public void initialize() throws InitializationException {
    // verify that if we're using grid identity login, we're also using the Local API
    if (isUseGridIdentLogin() && !isUseLocalApi()) {
        throw new InitializationException("Grid identity + CSM authentication can only be used with the local API!");
    }
    // verify we have a URL for the remote API
    if (!isUseLocalApi()) {
        try {
            new URL(getRemoteApplicationUrl());
        } catch (MalformedURLException ex) {
            throw new InitializationException("Could not determine a remote API url: " + ex.getMessage(), ex);
        }
    }
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:15,代碼來源:SDK43CQL2QueryProcessor.java

示例10: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
@Override
public void initialize(Properties parameters, InputStream wsdd) throws InitializationException {
    super.initialize(parameters, wsdd) ;
    DatasetService svc = new DatasetService(getAnzoProperties()) ;
    anzo = new Anzo(svc) ;
    if (!anzo.isConnected()) {
        throw new InitializationException("Error connecting to anzo.") ;
    }
    processor = new Cql2SparqlProcessor(anzo, getCvitMappers()) ;
    securitySvc = new GlobusSecurityService() {
        public String getCallerIdentity() throws Exception {
            return SecurityUtils.getCallerIdentity() ;
        }
    } ;
}
 
開發者ID:NCIP,項目名稱:digital-model-repository,代碼行數:16,代碼來源:DmrQueryProcessor.java

示例11: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
/**
 * Overriden to add initialization of the inheritance manager
 */
public void initialize(Properties parameters, InputStream wsdd)
		throws InitializationException {
	super.initialize(parameters, wsdd);
	initializeCqlToHqlTranslator();
}
 
開發者ID:NCIP,項目名稱:cananolab,代碼行數:9,代碼來源:PublicDataSDK4QueryProcessor.java

示例12: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
/**
 * Overridden to add initialization of the CQL to HQL translator
 */
public void initialize(Properties parameters, InputStream wsdd) throws InitializationException {
    super.initialize(parameters, wsdd);
    initializeCqlToHqlTranslator();
    initializeClassToQnameMappings();
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:9,代碼來源:SDK4QueryProcessor.java

示例13: configure

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
/**
 * Configure the query processor with the properties it requires as specified
 * in the Properties instance provided by getRequiredParameters(), and values
 * populated by the user's custom entries, if any.
 * 
 * Subclasses which need to do one-time initialization after configuration has completed
 * may override the <code>initialize()</code> method, which will be invoked
 * at the completion of <code>configure()</code>
 * 
 * @param parameters
 *      The parameters as configured by the user.  The set of keys must contain all
 *      of the keys contained in the Properties object returned 
 *      by <code>getRequiredParamters()</code>.  The values in the parameters will
 *      be either the user defined value or the default value from 
 *      <code>getRequiredParameters()</code>.
 * @param wsdd
 *      The input stream which contains the wsdd configuration for the data service.
 *      This stream may be important to locating type mappings for serializing and
 *      deserializing beans.
 * @param classToQnameMappings
 *      The mapping from classname to QName for serialization purposes.
 * @throws InitializationException
 */
public void configure(Properties parameters, InputStream wsdd, Mappings classToQnameMappings) throws InitializationException {
    verifyProvidedParameters(parameters);
    this.params = parameters;
    this.wsddStream = wsdd;
    this.classMappings = classToQnameMappings;
    initialize();
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:31,代碼來源:CQL2QueryProcessor.java

示例14: initialize

import gov.nih.nci.cagrid.data.InitializationException; //導入依賴的package包/類
/**
 * Perform any post-configuration initialization the query processor requires
 * When this method is called from the configure() method, the getConfiguredParameters()
 * and getConfiguredWsddStream() methods will return properly populated objects
 * 
 * @throws InitializationException
 */
protected void initialize() throws InitializationException {
    // left empty for subclass implementation
}
 
開發者ID:NCIP,項目名稱:cagrid-core,代碼行數:11,代碼來源:CQL2QueryProcessor.java


注:本文中的gov.nih.nci.cagrid.data.InitializationException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。