76ef4a469d124677822f8789cac340209083acf3.svn-base
1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.espeed.yxy.tool;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* 程序名称: EspeedMail_时速邮箱
* 程序版本: V1.0
* 作 者: 深圳市科飞时速网络技术有限公司(0755-88843776)
* 版权所有: 深圳市科飞时速网络技术有限公司
* 技术支持: Tech@21gmail.com
* 单元名称: 获取springApplicationContext中Bean的工具类
* 开始时间: 2013.10.1
* 程 序 员: 芮瑞
* 最后修改: 2014-02-25
* 备 注:功能主要包括(对企业的增删改查)
*/
public class SpringFactory implements ApplicationContextAware
{
private static ApplicationContext context;
public void setApplicationContext(ApplicationContext context)
throws BeansException
{
this.context = context;
}
/**
*
* @param id要获取的springBean的id
* @return
*/
public static Object getObject(String id) {
Object object = null;
object = context.getBean(id);
return object;
}
}