how to put(bind) object to jndi in spring declaratively?

后端 未结 5 1707
抹茶落季
抹茶落季 2020-12-06 06:46

We have a plain standalone spring application and we need to put jdbc datasource in jndi. (we use jboss treecache and it need datasource to be in the jndi).

Some go

5条回答
  •  没有蜡笔的小新
    2020-12-06 07:20

    Your can create a JndiExporter which uses a JndiTemplate to bind a map of object with a name:

    
        
        
              
                
                
                
                
              
        
    
    

    Your JndiExporter have to implements BeanFactoryAware to retrieve the spring bean with the injected BeanFactory.

    This is one possible may :)

提交回复
热议问题