From d1f27eff90719ed40d0d30d048f00908656b3028 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 24 Oct 2016 17:11:52 +0300 Subject: notifications: jdbctemplate -> resttemplate --- .../configuration/NotificationsConfiguration.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'juick-notifications/src/main/java/com/juick/notifications/configuration') diff --git a/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java b/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java index e1267de0..fd122724 100644 --- a/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/notifications/configuration/NotificationsConfiguration.java @@ -8,7 +8,6 @@ import com.mitchellbosecke.pebble.loader.Loader; import com.mitchellbosecke.pebble.loader.ServletLoader; import com.mitchellbosecke.pebble.spring4.PebbleViewResolver; import com.mitchellbosecke.pebble.spring4.extension.SpringExtension; -import org.apache.commons.dbcp2.BasicDataSource; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; @@ -17,7 +16,7 @@ import org.springframework.core.env.Environment; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; -import org.springframework.jdbc.core.JdbcTemplate; +import org.springframework.web.client.RestTemplate; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; @@ -42,11 +41,8 @@ public class NotificationsConfiguration extends WebMvcConfigurationSupport { ExecutorService service; @Bean - JdbcTemplate jdbc() { - BasicDataSource dataSource = new BasicDataSource(); - dataSource.setDriverClassName(env.getProperty("datasource_driver", "com.mysql.jdbc.Driver")); - dataSource.setUrl(env.getProperty("datasource_url")); - return new JdbcTemplate(dataSource); + RestTemplate rest() { + return new RestTemplate(); } @Inject private ServletContext servletContext; -- cgit v1.2.3