enhance spring support

This commit is contained in:
wenshao
2012-07-11 08:33:26 +08:00
parent 97b85470b9
commit ac7b4c71e5
3 changed files with 34 additions and 11 deletions
@@ -118,7 +118,7 @@ public class DruidDataSourceFactory implements ObjectFactory {
* @param properties the datasource configuration properties
* @throws Exception if an error occurs creating the data source
*/
@SuppressWarnings("deprecation")
@SuppressWarnings({ "deprecation", "rawtypes" })
public static DataSource createDataSource(Map properties) throws Exception {
DruidDataSource dataSource = new DruidDataSource();
String value = null;
@@ -0,0 +1,23 @@
package com.alibaba.druid.support.spring;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServer;
import org.springframework.beans.factory.FactoryBean;
public class MBeanServerFactoryBean implements FactoryBean {
public MBeanServer getObject() throws Exception {
return ManagementFactory.getPlatformMBeanServer();
}
public Class<?> getObjectType() {
return ManagementFactory.getPlatformMBeanServer().getClass();
}
public boolean isSingleton() {
return true;
}
}