java

但是發給對方v


package cn.itcast.elec.container;

import org.apache.commons.lang.StringUtils;

public class ServiceProvider {
	public static ServiceProviderCord spc;
	static {
//		System.out.println("aaaaaaaaaaaaa");
		spc =new ServiceProviderCord();
		spc.load("beans.xml");
	}
	public static Object getService(String serviceName){
//		System.out.println("bbbbbbbb");
		if (StringUtils.isBlank(serviceName)){
			throw new RuntimeException("當前服務名稱不存在");
		}
		Object object=null;
		if (spc.ac.containsBean(serviceName)){
//			System.out.println("ccccccccc");
			object=spc.ac.getBean(serviceName);
		}
		if (object == null){
			throw new RuntimeException("當前服務名稱["+serviceName+"]下的服務節點不存在");
			
		}
		return object;
	}

}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章