1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package jtr.remote.test; |
8 |
| |
9 |
| import java.rmi.registry.Registry; |
10 |
| |
11 |
| import jtr.remote.test.impl.TestGateway; |
12 |
| import jtr.remote.utils.RmiUtil; |
13 |
| import org.apache.log4j.Logger; |
14 |
| import org.apache.log4j.xml.DOMConfigurator; |
15 |
| |
16 |
| import static jtr.test.SystemProperties.*; |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| public class RemoteTestListener { |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| |
33 |
| |
34 |
| |
35 |
1
| public static void main(String[] args) {
|
36 |
1
| RmiUtil.setSystemProperties();
|
37 |
1
| String log4jConfig = System.getProperty(LOG4J_CONFIGURATION);
|
38 |
1
| if (log4jConfig != null) {
|
39 |
1
| DOMConfigurator.configure(log4jConfig);
|
40 |
| } |
41 |
| |
42 |
1
| String host = System.getProperty(RMI_REGISTRY_HOST, DEF_RMI_REGISTRY_HOST);
|
43 |
1
| int port = new Integer(System.getProperty(RMI_REGISTRY_PORT, DEF_RMI_REGISTRY_PORT.toString()));
|
44 |
| |
45 |
1
| logger.info("Instantiated a new RemoteTestListener");
|
46 |
1
| Registry registry = RmiUtil.launchRegistry(host,port);
|
47 |
1
| RmiUtil.registerService(registry,TestGateway.class,TEST_GW_SERVICE_NAME);
|
48 |
1
| logger.info("JTR-TestGatewayService launched");
|
49 |
1
| RmiUtil.logRegistryContent(registry);
|
50 |
| } |
51 |
| |
52 |
| private static Logger logger = Logger.getLogger(RemoteTestListener.class); |
53 |
| } |