// Path: tcc-transaction-core/src/main/java/org/pankai/tcctransaction/support/BeanFactory.java
// public interface BeanFactory {
// 
//     Object getBean(Class<?> clazz);
// 
// }


import org.pankai.tcctransaction.support.BeanFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
package org.pankai.tcctransaction.spring.support;


/**
 * Created by pktczwd on 2016/12/20.
 */
@Component
public class TccApplicationContext implements BeanFactory, ApplicationContextAware {

    private ApplicationContext applicationContext;

    @Override
    public Object getBean(Class<?> clazz) {
        return this.applicationContext.getBean(clazz);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
// Path: tcc-transaction-core/src/main/java/org/pankai/tcctransaction/support/BeanFactory.java
// public interface BeanFactory {
// 
//     Object getBean(Class<?> clazz);
// 
// }


// Path: tcc-transaction-spring/src/main/java/org/pankai/tcctransaction/spring/support/TccApplicationContext.java
import org.pankai.tcctransaction.support.BeanFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

package org.pankai.tcctransaction.spring.support;


/**
 * Created by pktczwd on 2016/12/20.
 */
@Component
public class TccApplicationContext implements BeanFactory, ApplicationContextAware {

    private ApplicationContext applicationContext;

    @Override
    public Object getBean(Class<?> clazz) {
        return this.applicationContext.getBean(clazz);
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;