本文整理汇总了Java中org.springframework.core.NestedIOException类的典型用法代码示例。如果您正苦于以下问题:Java NestedIOException类的具体用法?Java NestedIOException怎么用?Java NestedIOException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NestedIOException类属于org.springframework.core包,在下文中一共展示了NestedIOException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: collectImports
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* Recursively collect all declared {@code @Import} values. Unlike most
* meta-annotations it is valid to have several {@code @Import}s declared with
* different values; the usual process of returning values from the first
* meta-annotation on a class is not sufficient.
* <p>For example, it is common for a {@code @Configuration} class to declare direct
* {@code @Import}s in addition to meta-imports originating from an {@code @Enable}
* annotation.
* @param sourceClass the class to search
* @param imports the imports collected so far
* @param visited used to track visited classes to prevent infinite recursion
* @throws IOException if there is any problem reading metadata from the named class
*/
private void collectImports(SourceClass sourceClass, Set<SourceClass> imports, Set<SourceClass> visited) throws IOException {
try {
if (visited.add(sourceClass)) {
for (SourceClass annotation : sourceClass.getAnnotations()) {
String annName = annotation.getMetadata().getClassName();
if (!annName.startsWith("java") && !annName.equals(Import.class.getName())) {
collectImports(annotation, imports, visited);
}
}
imports.addAll(sourceClass.getAnnotationAttributes(Import.class.getName(), "value"));
}
}
catch (ClassNotFoundException ex) {
throw new NestedIOException("Unable to collect imports", ex);
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:30,代码来源:ConfigurationClassParser.java
示例2: getRelated
import org.springframework.core.NestedIOException; //导入依赖的package包/类
private SourceClass getRelated(String className) throws IOException {
if (this.source instanceof Class<?>) {
try {
Class<?> clazz = resourceLoader.getClassLoader().loadClass(className);
return asSourceClass(clazz);
}
catch (ClassNotFoundException ex) {
// Ignore -> fall back to ASM next, except for core java types.
if (className.startsWith("java")) {
throw new NestedIOException("Failed to load class [" + className + "]", ex);
}
return new SourceClass(metadataReaderFactory.getMetadataReader(className));
}
}
return asSourceClass(className);
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:17,代码来源:ConfigurationClassParser.java
示例3: refresh
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* TODO 刷新
*
* @param inputStream
* @param resource
* @param configuration
* @throws NestedIOException
*/
public static void refresh(java.io.InputStream inputStream,
String resource, Configuration configuration)
throws NestedIOException {
try {
XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(
inputStream, configuration, resource,
configuration.getSqlFragments());
xmlMapperBuilder.parse1();
} catch (Exception e) {
throw new NestedIOException("Failed to parse mapping resource: '"
+ resource + "'", e);
} finally {
ErrorContext.instance().reset();
}
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:26,代码来源:SqlSessionFactoryBean.java
示例4: refresh
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* TODO 刷新
*
* @param inputStream
* @param resource
* @param configuration
* @throws NestedIOException
*/
public static void refresh(java.io.InputStream inputStream,
String resource, Configuration configuration)
throws NestedIOException {
try {
XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(
inputStream, configuration, resource,
configuration.getSqlFragments());
xmlMapperBuilder.parse();
} catch (Exception e) {
throw new NestedIOException("Failed to parse mapping resource: '"
+ resource + "'", e);
} finally {
ErrorContext.instance().reset();
}
}
开发者ID:whatlookingfor,项目名称:spring-boot-sample,代码行数:26,代码来源:SqlSessionFactoryBean.java
示例5: getFile
import org.springframework.core.NestedIOException; //导入依赖的package包/类
static File getFile(Object vfsResource) throws IOException {
if (VFS_VER.V2.equals(version)) {
if ((Boolean) invokeVfsMethod(VFS_UTILS_METHOD_IS_NESTED_FILE, null, vfsResource)) {
throw new IOException("File resolution not supported for nested resource: " + vfsResource);
}
try {
return new File((URI) invokeVfsMethod(VFS_UTILS_METHOD_GET_COMPATIBLE_URI, null, vfsResource));
}
catch (Exception ex) {
throw new NestedIOException("Failed to obtain File reference for " + vfsResource, ex);
}
}
else {
return (File) invokeVfsMethod(GET_PHYSICAL_FILE, vfsResource);
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:17,代码来源:VfsUtils.java
示例6: init
import org.springframework.core.NestedIOException; //导入依赖的package包/类
public void init() throws Exception {
MqlMapConfigParser configParser = new MqlMapConfigParser();
for (Resource configLocation : configLocations) {
InputStream is = configLocation.getInputStream();
try {
logger.debug("Mql configuration parse resource file. File name is "+configLocation.getFilename());
configParser.parse(is);
logger.debug("Mql configuration parse resource file finished. File name is "+configLocation.getFilename());
} catch (RuntimeException ex) {
throw new NestedIOException("Failed to parse config configuration. File name is " + configLocation.getFilename(), ex.getCause());
}
}
configParser.validateMapping();
this.configParser = configParser;
logger.info("Mongodb orm framework has ready.");
}
开发者ID:yuxiangping,项目名称:mongodb-orm,代码行数:17,代码来源:MongoORMFactoryBean.java
示例7: buildSqlSessionFactory
import org.springframework.core.NestedIOException; //导入依赖的package包/类
@Override
protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
try {
return super.buildSqlSessionFactory();
} catch (NestedIOException e) {
logger.error("mapper.xml解析报错:",e);
throw new NestedIOException("Failed to parse mapping resource: ", e);
} finally {
ErrorContext.instance().reset();
}
}
开发者ID:nyh137,项目名称:SSMFrameBase,代码行数:12,代码来源:LocalSqlSessionFactory.java
示例8: asSourceClass
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* Factory method to obtain a {@link SourceClass} from a class name.
*/
public SourceClass asSourceClass(String className) throws IOException {
if (className.startsWith("java")) {
// Never use ASM for core java types
try {
return new SourceClass(this.resourceLoader.getClassLoader().loadClass(className));
}
catch (ClassNotFoundException ex) {
throw new NestedIOException("Failed to load class [" + className + "]", ex);
}
}
return new SourceClass(this.metadataReaderFactory.getMetadataReader(className));
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:16,代码来源:ConfigurationClassParser.java
示例9: deserialize
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* Read from the supplied {@code InputStream} and deserialize the contents
* into an object.
* @see ObjectInputStream#readObject()
*/
@Override
@SuppressWarnings("resource")
public Object deserialize(InputStream inputStream) throws IOException {
ObjectInputStream objectInputStream = new ConfigurableObjectInputStream(inputStream, this.classLoader);
try {
return objectInputStream.readObject();
}
catch (ClassNotFoundException ex) {
throw new NestedIOException("Failed to deserialize object type", ex);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:17,代码来源:DefaultDeserializer.java
示例10: getURI
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* This implementation builds a URI based on the URL returned
* by {@link #getURL()}.
*/
@Override
public URI getURI() throws IOException {
URL url = getURL();
try {
return ResourceUtils.toURI(url);
}
catch (URISyntaxException ex) {
throw new NestedIOException("Invalid URI [" + url + "]", ex);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:15,代码来源:AbstractResource.java
示例11: getURL
import org.springframework.core.NestedIOException; //导入依赖的package包/类
@Override
public URL getURL() throws IOException {
try {
return VfsUtils.getURL(this.resource);
}
catch (Exception ex) {
throw new NestedIOException("Failed to obtain URL for file " + this.resource, ex);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:VfsResource.java
示例12: getURI
import org.springframework.core.NestedIOException; //导入依赖的package包/类
@Override
public URI getURI() throws IOException {
try {
return VfsUtils.getURI(this.resource);
}
catch (Exception ex) {
throw new NestedIOException("Failed to obtain URI for " + this.resource, ex);
}
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:VfsResource.java
示例13: reloadXML
import org.springframework.core.NestedIOException; //导入依赖的package包/类
public void reloadXML() throws Exception {
SqlSessionFactory factory = context.getBean(SqlSessionFactory.class);
Configuration configuration = factory.getConfiguration();
// 移除加载项
removeConfig(configuration);
// 重新扫描加载
for (String basePackage : basePackages) {
Resource[] resources = getResource(basePackage, XML_RESOURCE_PATTERN);
if (resources != null) {
for (int i = 0; i < resources.length; i++) {
if (resources[i] == null) {
continue;
}
try {
XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(resources[i].getInputStream(),
configuration, resources[i].toString(), configuration.getSqlFragments());
xmlMapperBuilder.parse();
} catch (Exception e) {
throw new NestedIOException("Failed to parse mapping resource: '" + resources[i] + "'", e);
} finally {
ErrorContext.instance().reset();
}
}
}
}
}
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:28,代码来源:MapperLoader.java
示例14: close
import org.springframework.core.NestedIOException; //导入依赖的package包/类
@[email protected]
public void close() throws IOException {
try {
server.stop();
} catch (Exception e) {
throw new NestedIOException("With nested cause..", e);
}
}
开发者ID:javanotes,项目名称:reactive-data,代码行数:9,代码来源:WebbitRestServerBean.java
示例15: buildRabbitDbaseFactory
import org.springframework.core.NestedIOException; //导入依赖的package包/类
public RabbitDbaseFactory buildRabbitDbaseFactory() throws Exception {
Configuration configuration = null;
XMLConfigBuilder configBuilder = null;
if (configLocation != null) {
configBuilder = new XMLConfigBuilder(configLocation.getInputStream(), configurationProperties);
configuration = configBuilder.getConfiguration();
} else {
configuration = new Configuration();
configuration.setVariables(configurationProperties);
}
if (configBuilder != null) {
try {
configBuilder.parse();
logger.trace("Parsed configuration file: '" + this.configLocation + "'");
} catch (Exception ex) {
throw new NestedIOException("Failed to parse config resource: " + this.configLocation, ex);
}
}
Environment environment = new Environment();
for (Entry<String, DataSourceBean> entry : dataSourceMap.entrySet()) {
String name = entry.getKey();
DataSourceBean dataSource = entry.getValue();
dataSourceFactory.addDataSource(name, dataSource);
environment.addCacheDataSource(dataSource.getDataSource());
}
environment.setDataSourceFactory(dataSourceFactory);
configuration.setEnvironment(environment);
String[] entityPackageNames = StringUtils.tokenizeToStringArray(entityPackages);
configuration.addEntitys(entityPackageNames);
String[] mapperPackageNames = StringUtils.tokenizeToStringArray(mapperPackages);
configuration.addMappers(mapperPackageNames);
configuration.addCaches(cacheMap);
return rabbitDbaseFactoryBuilder.build(configuration);
}
开发者ID:xuegongzi,项目名称:rabbitframework,代码行数:35,代码来源:RabbitDbaseFactoryBean.java
示例16: getURI
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* This implementation builds a URI based on the URL returned
* by {@link #getURL()}.
*/
public URI getURI() throws IOException {
URL url = getURL();
try {
return ResourceUtils.toURI(url);
}
catch (URISyntaxException ex) {
throw new NestedIOException("Invalid URI [" + url + "]", ex);
}
}
开发者ID:bestarandyan,项目名称:ShoppingMall,代码行数:14,代码来源:AbstractResource.java
示例17: deserialize
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* Reads the input stream and deserializes into an object.
*/
public Object deserialize(InputStream inputStream) throws IOException {
ObjectInputStream objectInputStream = new ObjectInputStream(inputStream);
try {
return objectInputStream.readObject();
}
catch (ClassNotFoundException ex) {
throw new NestedIOException("Failed to deserialize object type", ex);
}
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:13,代码来源:DefaultDeserializer.java
示例18: reloadXML
import org.springframework.core.NestedIOException; //导入依赖的package包/类
public void reloadXML() throws Exception {
SqlSessionFactory factory = context.getBean(SqlSessionFactory.class);
Configuration configuration = factory.getConfiguration();
// 移除加载项
removeConfig(configuration);
// 重新扫描加载
for (String basePackage : basePackages) {
Resource[] resources = getResource(basePackage, XML_RESOURCE_PATTERN);
if (resources != null) {
for (int i = 0; i < resources.length; i++) {
if (resources[i] == null) {
continue;
}
try {
XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(resources[i].getInputStream(), configuration, resources[i].toString(),
configuration.getSqlFragments());
xmlMapperBuilder.parse();
} catch (Exception e) {
throw new NestedIOException("Failed to parse mapping resource: '" + resources[i] + "'", e);
} finally {
ErrorContext.instance().reset();
}
}
}
}
}
开发者ID:haogrgr,项目名称:haogrgr-test,代码行数:28,代码来源:XMLMapperLoader.java
示例19: parse
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* Begins parsing from the provided Reader.
*/
public void parse(Reader reader) throws NestedIOException {
try {
Document doc = createDocument(reader);
parse(doc.getLastChild());
} catch (Exception e) {
throw new NestedIOException("Error parsing XML. Cause: " + e, e);
}
}
开发者ID:yuxiangping,项目名称:mongodb-orm,代码行数:12,代码来源:NodeletParser.java
示例20: parse
import org.springframework.core.NestedIOException; //导入依赖的package包/类
/**
* Parse resource.
*
* @param inputStream
* @throws NestedIOException
*/
public void parse(InputStream inputStream) throws NestedIOException {
parser.parse(inputStream);
}
开发者ID:yuxiangping,项目名称:mongodb-orm,代码行数:10,代码来源:MqlMapConfigParser.java
注:本文中的org.springframework.core.NestedIOException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论