class TransactionManagerFactoryBean implements FactoryBean<TransactionManager> {

    @Override
    public TransactionManager getObject() throws Exception {
        if (ConfigContext.getCurrentContextConfig() != null &&
                ConfigContext.getCurrentContextConfig().getObject(RiceConstants.SPRING_TRANSACTION_MANAGER) != null) {
            return null;
        }
        return (TransactionManager) Proxy.newProxyInstance(getClass().getClassLoader(),
                new Class<?>[]{getObjectType()},
                new LazyInitializationHandler());
    }

}