Created
October 30, 2016 18:37
-
-
Save danieltnaves/15baa7459465bb6e04b4693d8af74ed4 to your computer and use it in GitHub Desktop.
Expose DatabaseManagerSwing start via JMX
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 br.com.naves.configuration.db; | |
import org.hsqldb.util.DatabaseManagerSwing; | |
import org.springframework.context.annotation.Profile; | |
import org.springframework.jmx.export.annotation.ManagedOperation; | |
import org.springframework.jmx.export.annotation.ManagedResource; | |
import org.springframework.stereotype.Component; | |
@Component | |
@ManagedResource(objectName="br.com.naves.configuration.db:name=DevelopmentDatabaseManager", | |
description = "Essa classe expõe métodos para o gerenciamento" | |
+ "do banco de dados HSQL usado apenas durante o desenvolvimento") | |
@Profile("development") | |
public class DevelopmentDatabaseManagerSwing { | |
@ManagedOperation | |
public void startDBManager() { | |
//hsqldb | |
DatabaseManagerSwing.main(new String[] { "--url", "jdbc:hsqldb:mem:testdb;sql.syntax_mys=true", "--user", "sa", "--password", "" }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment