All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.biz.context.SpringContext Maven / Gradle / Ivy

There is a newer version: 3.3.x.20241003.RELEASE
Show newest version
/*
 * Copyright (c) 2018 (https://github.com/hiwepy).
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.springframework.biz.context;

import javax.sql.DataSource;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;

public interface SpringContext {

	/**
	 * 根据对象类型获取服务对象
	 * @param requiredType : 目标对象类型
	 * @param  对象泛型
	 * @return 对象
	 */
	public abstract  T getInstance(Class requiredType);
	
	/**
	 * 根据服务名获取服务对象
	 * @param name : 目标对象名称
	 * @return 对象 
	 */
	public abstract Object getInstance(String name);
	
	/**
	 * 获取名称为 dataSource 的数据源对象
	 * @return {@link DataSource} instance
	 */
	public abstract DataSource getDataSource();
	
	/**
	 * 根据数据源名称获取数据源对象
	 * @param datasourceName : 数据源名称
	 * @return {@link DataSource} instance
	 */
	public abstract DataSource getDataSource(String datasourceName);
	
	public abstract void setApplicationContext(ApplicationContext applicationContext) throws BeansException;
	
	public abstract ApplicationContext getApplicationContext();
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy