Created
August 26, 2015 05:45
-
-
Save d10xa/8c530a9c166ecb378c9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.d10xa.sample.config; | |
import org.h2.tools.Server; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.context.annotation.DependsOn; | |
import java.sql.SQLException; | |
@Configuration | |
public class H2ServerConfig { | |
@Bean(destroyMethod = "stop", initMethod = "start") | |
@DependsOn("h2WebServer") | |
public org.h2.tools.Server h2Server() throws SQLException { | |
return new Server().createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092"); | |
} | |
@Bean(destroyMethod = "stop", initMethod = "start") | |
public org.h2.tools.Server h2WebServer() throws SQLException { | |
return new Server().createWebServer("-web", "-webAllowOthers", "-webPort", "8082"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment