• R/O
  • SSH
  • HTTPS

clearfybusiness: Commit


Commit MetaInfo

Révision216 (tree)
l'heure2019-06-19 17:17:14
Auteurdaianji

Message de Log

(empty log message)

Change Summary

Modification

--- org.clearfy/org.clearfy.datawrapper/src/main/java/org/clearfy/datawrapper/h2db/MiniServer.java (revision 215)
+++ org.clearfy/org.clearfy.datawrapper/src/main/java/org/clearfy/datawrapper/h2db/MiniServer.java (revision 216)
@@ -50,15 +50,56 @@
5050 * 既定のデータファイル
5151 */
5252 public static final String DEFAULT_SERVER_FILE = "miniserv";
53-
53+
54+ private int tcpPort = DEFAULT_TCP_PORT;
55+
56+ private int httpPort = DEFAULT_HTTP_PORT;
57+
58+ public MiniServer(){
59+
60+ }
61+
62+ public void setTcpPort(int port){
63+ this.tcpPort = port;
64+ }
65+
66+ public int getTcpPort(){
67+ return this.tcpPort;
68+ }
69+
70+ public void setHttpPort(int port){
71+ this.httpPort = port;
72+ }
73+
74+ public int getHttpPort(){
75+ return this.httpPort;
76+ }
77+
5478 /**
5579 * @param args
5680 */
5781 public static void main(String[] args) {
82+
83+ MiniServer minisrv = new MiniServer();
84+
85+ for(int i=0;i< args.length;i++){
86+ if(args[i].equals("-tcp")){
87+ minisrv.setTcpPort(Integer.parseInt(args[i+1]));
88+ i++;
89+ }
90+ if(args[i].equals("-http")){
91+ minisrv.setHttpPort(Integer.parseInt(args[i+1]));
92+ i++;
93+ }
94+ }
95+
5896 ServerSwitch sSwitch = new ServerSwitch();
5997 sSwitch.loadDriver();
60- sSwitch.setServerPorts(DEFAULT_TCP_PORT, DEFAULT_HTTP_PORT);
61-
98+ sSwitch.setServerPorts(
99+ minisrv.getTcpPort(),
100+ minisrv.getHttpPort()
101+ );
102+
62103 File file = new File(DEFAULT_SERVER_FILE);
63104 String fullpath = file.getAbsolutePath();
64105 String url = "jdbc:h2:tcp:localhost:" + DEFAULT_TCP_PORT + "//" + fullpath;
Afficher sur ancien navigateur de dépôt.