资源简介

spring3.2.8使用aop的简单实例

资源截图

代码片段和文件信息

package com.ruishenh.utils;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class SpringFactoryUtil implements ApplicationContextAware{

private static  BeanFactory beanFactory;

public   void setApplicationContext(ApplicationContext ac)
throws BeansException {
SpringFactoryUtil.beanFactory=ac;
}

public static   object getBean(String name) throws BeansException {
return beanFactory.getBean(name);
}

public static  T getBean(String name Class requiredType)
throws BeansException {
return beanFact

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-26 21:56  idle-parent\
     文件         393  2014-04-26 09:35  idle-parent\.project
     目录           0  2014-04-26 09:17  idle-parent\.settings\
     文件         240  2014-04-26 09:36  idle-parent\.settings\org.maven.ide.eclipse.prefs
     目录           0  2014-04-26 20:25  idle-parent\idle-common\
     文件         709  2014-04-26 19:45  idle-parent\idle-common\.classpath
     文件         565  2014-04-26 09:34  idle-parent\idle-common\.project
     目录           0  2014-04-26 09:18  idle-parent\idle-common\.settings\
     文件         664  2014-04-26 19:45  idle-parent\idle-common\.settings\org.eclipse.jdt.core.prefs
     文件         240  2014-04-26 09:36  idle-parent\idle-common\.settings\org.maven.ide.eclipse.prefs
     文件         509  2014-04-26 09:37  idle-parent\idle-common\pom.xml
     目录           0  2014-04-26 09:18  idle-parent\idle-common\src\
     目录           0  2014-04-26 09:18  idle-parent\idle-common\src\main\
     目录           0  2014-04-26 17:40  idle-parent\idle-common\src\main\java\
     目录           0  2014-04-26 17:40  idle-parent\idle-common\src\main\java\com\
     目录           0  2014-04-26 17:40  idle-parent\idle-common\src\main\java\com\ruishenh\
     目录           0  2014-04-26 17:40  idle-parent\idle-common\src\main\java\com\ruishenh\utils\
     文件        1897  2014-04-26 20:30  idle-parent\idle-common\src\main\java\com\ruishenh\utils\SpringFactoryUtil.java
     目录           0  2014-04-26 09:18  idle-parent\idle-common\src\main\resources\
     目录           0  2014-04-26 09:18  idle-parent\idle-common\src\test\
     目录           0  2014-04-26 09:18  idle-parent\idle-common\src\test\java\
     目录           0  2014-04-26 09:18  idle-parent\idle-common\src\test\resources\
     目录           0  2014-04-26 21:56  idle-parent\idle-common\target\
     目录           0  2014-04-26 20:25  idle-parent\idle-common\target\classes\
     目录           0  2014-04-26 20:25  idle-parent\idle-common\target\classes\com\
     目录           0  2014-04-26 20:25  idle-parent\idle-common\target\classes\com\ruishenh\
     目录           0  2014-04-26 20:25  idle-parent\idle-common\target\classes\com\ruishenh\utils\
     文件        2648  2014-04-26 20:38  idle-parent\idle-common\target\classes\com\ruishenh\utils\SpringFactoryUtil.class
     目录           0  2014-04-26 21:56  idle-parent\idle-common\target\dependency-maven-plugin-markers\
     文件           0  2014-04-26 21:56  idle-parent\idle-common\target\dependency-maven-plugin-markers\aopalliance-aopalliance-java-source-sources-1.0.resolved
     文件           0  2014-04-26 21:56  idle-parent\idle-common\target\dependency-maven-plugin-markers\commons-logging-commons-logging-java-source-sources-1.1.3.resolved
............此处省略163个文件信息

评论

共有 条评论