LOGGER.debug("using RMI registry at port {}", port);
rgstry = LocateRegistry.createRegistry(port);
String host = InetAddress.getLocalHost().getHostName();
ExamSystem subsystem = system
.fork(options(
systemProperty(RMI_HOST_PROPERTY).value(host),
systemProperty(RMI_PORT_PROPERTY).value(Integer.toString(port)),
systemProperty(RMI_NAME_PROPERTY).value(name),
invokerConfiguration,
systemProperty(EXAM_INJECT_PROPERTY).value("true"),
editConfigurationFileExtend("etc/system.properties", "jline.shutdownhook",
"true")));
target = new RBCRemoteTarget(name, port, subsystem.getTimeout());
System.setProperty("java.protocol.handler.pkgs", "org.ops4j.pax.url");
URL sourceDistribution = new URL(framework.getFrameworkURL());
targetFolder = retrieveFinalTargetFolder(subsystem);
ArchiveExtractor.extract(sourceDistribution, targetFolder);
File karafBase = searchKarafBase(targetFolder);
File karafHome = karafBase;
versionAdaptions = createVersionAdapter(karafBase);
DependenciesDeployer deployer = new DependenciesDeployer(subsystem, karafBase,
karafHome);
deployer.copyBootClasspathLibraries();
updateLogProperties(karafHome, subsystem);
setupSystemProperties(karafHome, subsystem);
List<KarafDistributionConfigurationFileOption> options = new ArrayList<KarafDistributionConfigurationFileOption>(
Arrays.asList(subsystem.getOptions(KarafDistributionConfigurationFileOption.class)));
options.addAll(fromFeatureOptions(subsystem.getOptions(KarafFeaturesOption.class)));
options.addAll(fromFeatureOptions(KarafDistributionOption.features(EXAM_REPO_URL,
"exam")));
if (framework.isUseDeployFolder()) {
deployer.copyReferencedArtifactsToDeployFolder();