@Test public void testGetObject() throws Exception { Jta.configure(this.transactionManager, this.userTransaction); TransactionManager transactionManager = transactionManagerFactoryBean.getObject(); TargetedInvocationHandler<TransactionManager> handler = (TargetedInvocationHandler<TransactionManager>)Proxy.getInvocationHandler(transactionManager); assertNull(handler.getTarget()); transactionManager.getTransaction(); assertEquals(this.transactionManager, handler.getTarget()); }
@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()); }
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()); } }
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()); }  }
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()); }  @Override TransactionManager getObject(); @Override Class<TransactionManager> getObjectType(); @Override boolean isSingleton(); }
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()); }  @Override TransactionManager getObject(); @Override Class<TransactionManager> getObjectType(); @Override boolean isSingleton();  }