5 |
|
import java.lang.reflect.*; |
6 |
|
import java.util.*; |
7 |
|
import java.io.*; |
8 |
+ |
import java.net.*; |
9 |
|
|
10 |
|
/** |
11 |
|
* CORBA Services |
31 |
|
|
32 |
|
public static void main(String args[]) { |
33 |
|
|
34 |
< |
System.setProperty("org.omg.CORBA.ORBClass","jacorb.orb.ORB"); |
35 |
< |
System.setProperty("org.omg.CORBA.ORBSingletonClass","jacorb.orb.ORBSingleton"); |
34 |
> |
System.setProperty("org.omg.CORBA.ORBClass","jacorb.orb.ORB"); |
35 |
> |
System.setProperty("org.omg.CORBA.ORBSingletonClass","jacorb.orb.ORBSingleton"); |
36 |
|
|
37 |
+ |
System.out.println("--- i-scream CORBA Services Manager ---"); |
38 |
+ |
System.out.println("--- Starting System ---"); |
39 |
+ |
|
40 |
|
String okUrls = DEFAULTOKURLS; |
41 |
|
String servicesConf = DEFAULTSERVICESCONF; |
42 |
|
String webDir = DEFAULTWEBDIR; |
62 |
|
} |
63 |
|
} |
64 |
|
|
65 |
+ |
System.out.println("--- Reading Configuration ---"); |
66 |
+ |
|
67 |
|
LinkedList serviceList = getServicesList(servicesConf); |
68 |
|
String[] svcList = new String[serviceList.size()]; |
69 |
|
LinkedList[] svcListParams = new LinkedList[serviceList.size()]; |
79 |
|
svcListParams[j] = l; |
80 |
|
j++; |
81 |
|
} |
82 |
< |
|
82 |
> |
|
83 |
> |
System.out.println("--- Starting CORBA Services ---"); |
84 |
> |
|
85 |
|
// start the services |
86 |
|
try { |
87 |
|
|
97 |
|
Class myClass = myClassLoader.loadClass(svcList[k]); |
98 |
|
// and we don't support passing of individual args, but we will ;-) so its just null |
99 |
|
String[] passedArgs = new String[svcListParams[k].size()]; |
100 |
+ |
String arglist = ""; |
101 |
|
i = svcListParams[k].iterator(); |
102 |
|
int p = 0; |
103 |
|
while(i.hasNext()) { |
104 |
|
passedArgs[p] = (String) i.next(); |
105 |
+ |
arglist += " " + passedArgs[p]; |
106 |
|
p++; |
107 |
|
} |
108 |
|
|
119 |
|
|
120 |
|
// Finally we start it going |
121 |
|
anApp.start(); |
122 |
+ |
System.out.println(svcList[k]+arglist); |
123 |
|
|
124 |
|
// Now we go and start the rest of the Apps listed |
125 |
|
} |
128 |
|
System.out.println(e); |
129 |
|
e.printStackTrace(); |
130 |
|
} |
131 |
< |
|
131 |
> |
|
132 |
> |
System.out.println("--- Starting Mini WebServer ---"); |
133 |
> |
|
134 |
> |
String host; |
135 |
> |
try { |
136 |
> |
host = InetAddress.getLocalHost().getHostName(); |
137 |
> |
} catch(UnknownHostException e) { |
138 |
> |
host = "<unknown>"; |
139 |
> |
} |
140 |
> |
System.out.println("Host:\t\t"+host); |
141 |
> |
System.out.println("Port:\t\t"+port); |
142 |
> |
System.out.println("URL List File:\t"+okUrls); |
143 |
> |
System.out.println("Web Directory:\t"+webDir); |
144 |
> |
|
145 |
|
// start the mini-webserver |
146 |
|
MiniWebServer mws = new MiniWebServer(port, okUrls, webDir); |
147 |
|
mws.start(); |
148 |
+ |
|
149 |
+ |
System.out.println("--- i-scream CORBA Services Ready ---"); |
150 |
|
} |
151 |
|
|
152 |
|
private static void usage() { |