Iteración 3(Versión sin idiomas)
[ISBets21MAUBRY] / eclipse-workspace / ISBets21MAUBRY / src / main / java / dataAccess / ObjectdbManagerServerAWS.java
1 package dataAccess;
2
3
4 import configuration.ConfigXML;
5
6
7
8 public class ObjectdbManagerServerAWS {
9
10
11
12         public static void main(String[] args) {
13
14                 ConfigXML c=ConfigXML.getInstance();
15                 
16                 if (c.isDatabaseLocal()) {
17                         System.out.println("\nERROR, the database is configured as local");
18                 }
19                 else {
20                 try{
21
22                         System.out.println("Lauching objectdb server");
23                     try { // Se va a ejecutar en máquina Linux: usar "/"
24                         String st="java -cp resources/objectdb.jar com.objectdb.Server -port "+ c.getDatabasePort()+" start";
25                         System.out.println(st);
26                         Runtime.getRuntime().exec(st);
27                     } catch (Exception ioe) {
28                         System.out.println (ioe);
29                     }
30                         
31                     System.out.println("\nAccess granted to: "+c.getUser());
32                     
33                     System.out.println("\nPress key to exit this database server... ");
34                     
35                     while(System.in.available()==0){
36                         Thread.sleep(1000);
37                         }
38                         
39                 } catch (Exception e) {
40                         System.out.println("Something has happened in ObjectdbManagerServer: "+e.toString());
41
42                 }
43                 
44                 }
45         }
46                 
47         }
48
49