package com.pcloud.common.context;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

/**
 * @描述：获取spring上下文
 * @作者：DiSeng.H
 * @创建时间：2016年3月11日,上午11:50:44
 * @版本：1.0
 */
@Lazy(value=false)
@Component
public class ApplicationContextAware implements org.springframework.context.ApplicationContextAware {
private static ApplicationContext ctx;
	
	public void setApplicationContext(ApplicationContext applicationContext)
			throws BeansException {
		ApplicationContextAware.ctx = applicationContext;
	}
	
	public static ApplicationContext getApplicationContext(){
		return ctx;
	}
}
