1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package jtr.remote.cl; |
8 |
| |
9 |
| import java.rmi.Remote; |
10 |
| import java.rmi.registry.Registry; |
11 |
| import jtr.remote.cl.impl.JtrRmiClassLoaderServerImpl; |
12 |
| import jtr.remote.utils.RmiUtil; |
13 |
| |
14 |
| import static jtr.test.SystemProperties.*; |
15 |
| import org.apache.log4j.Logger; |
16 |
| |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
| |
22 |
| |
23 |
| public class JtrRmiClassLoaderServerLauncher { |
24 |
| |
25 |
1
| public static Remote launch() {
|
26 |
1
| Remote srvc = null;
|
27 |
| |
28 |
1
| String host = System.getProperty(RMI_REGISTRY_HOST, DEF_RMI_REGISTRY_HOST);
|
29 |
1
| int port = new Integer(System.getProperty(RMI_REGISTRY_PORT, DEF_RMI_REGISTRY_PORT.toString()));
|
30 |
| |
31 |
1
| Registry registry = RmiUtil.launchRegistry(host,port);
|
32 |
1
| logger.info("Registry launched");
|
33 |
1
| srvc = RmiUtil.registerService(registry,JtrRmiClassLoaderServerImpl.class,SERVER_CLASS_LOADER_SERVICE_NAME);
|
34 |
1
| logger.info("Registered class-loader service");
|
35 |
1
| RmiUtil.logRegistryContent(registry);
|
36 |
| |
37 |
1
| return srvc;
|
38 |
| } |
39 |
| |
40 |
| private static Logger logger = Logger.getLogger(JtrRmiClassLoaderServerLauncher.class); |
41 |
| } |