public LocalConfiguration getConfiguration() { return container.getConfiguration(); }
if (container.getState().isStarted()) throw new IllegalArgumentException("Container " + description + " failed to start because it is currently " + container.getState()); container.setConfiguration(config); container.start(); } catch (Exception e) { throw new RuntimeException(
/** * Creates the VM args token for the jvm.config file. * @return the VM args token for the jvm.config file. */ private Token createVmArgsToken() { StringBuilder jvmArgs = new StringBuilder(); File hotFixJar = new File(jrunContainer.getHome() + "/servers/lib/54101.jar"); if (hotFixJar.exists()) { jvmArgs.append("-Djava.rmi.server.RMIClassLoaderSpi=jrunx.util.JRunRMIClassLoaderSpi "); } jvmArgs.append("-Dsun.io.useCanonCaches=false "); jvmArgs.append("-Djmx.invoke.getters=true "); jvmArgs.append("-Xms32m "); jvmArgs.append("-Xmx128m "); ReplaceTokens.Token tokenVmArgs = new ReplaceTokens.Token(); tokenVmArgs.setKey("jrun.jvm.args"); tokenVmArgs.setValue(jvmArgs.toString()); return tokenVmArgs; }
/** * Creates the classpath token for the jvm.config file. * @return the classpath token for the jvm.config file. */ private Token createClassPathToken() { StringBuilder sb = new StringBuilder(); sb.append(jrunContainer.getHome() + "/servers/lib,"); sb.append(jrunContainer.getHome() + "/lib/macromedia_drivers.jar,"); sb.append(jrunContainer.getHome() + "/lib/webservices.jar"); if (jrunContainer.getExtraClasspath().length > 0) { sb.append(","); String[] extraPaths = jrunContainer.getExtraClasspath(); for (int i = 0; i < extraPaths.length; i++) { sb.append(extraPaths[i].replace('\\', '/')); if (i < extraPaths.length - 1) { sb.append(","); } } } ReplaceTokens.Token tokenClasspath = new ReplaceTokens.Token(); tokenClasspath.setKey(JRun4xPropertySet.JRUN_CLASSPATH); tokenClasspath.setValue(sb.toString()); return tokenClasspath; }
String initialConfiguration = getFileHandler().append(container.getHome(), CONFIGURATION); getFileHandler().copyDirectory(initialConfiguration, getHome()); if (container.getExtraClasspath() != null && container.getExtraClasspath().length != 0) for (String classpathElement : container.getExtraClasspath()) if (container.getSharedClasspath() != null && container.getSharedClasspath().length != 0) for (String classpathElement : container.getSharedClasspath()) String altDeployDir = container.getConfiguration(). getPropertyValue(JBossPropertySet.ALTERNATIVE_DEPLOYMENT_DIR); if (altDeployDir != null && !altDeployDir.equals("")) container.getLogger().info("Using non-default deployment target directory " + altDeployDir, this.getClass().getName()); deployments = getFileHandler().append(getHome(), altDeployDir);
List<Deployable> deployables = start.getDeployables(); LocalConfiguration configuration = container.getConfiguration(); parameters.setParameter("containerId", container.getId()); parameters.setParameter("configurationType", configuration.getType().toString()); parameters.setParameter("timeout", String.valueOf(container.getTimeout())); if (container.getHome() != null) parameters.setParameter("containerHome", container.getHome()); parameters.setParameter("xmlReplacements", setupXmlReplacements(container)); parameters.setParameter("containerOutput", container.getOutput()); container.getLogger().getLevel().toString()); if (container.isAppend())
String[] classPath = installedContainer.getExtraClasspath(); if (classPath != null) classPath = installedContainer.getSharedClasspath(); if (classPath != null) String sourceConf = getFileHandler().append(installedContainer.getHome(), "conf"); String targetConf = getFileHandler().createDirectory(getHome(), "conf"); getFileHandler().copyDirectory(sourceConf, targetConf);
InstalledLocalContainer container = (InstalledLocalContainer) createContainer(configuration); Deployable war = new DefaultDeployableFactory().createDeployable(container.getId(), getTestData().getTestDataFileFor("simple-war"), DeployableType.WAR); configuration.addDeployable(war); getTestData().containerType, createConfiguration(ConfigurationType.EXISTING, targetLocation.getPath())); assertContainer.setLogger(getLogger()); assertContainer.setHome(targetLocation.getPath()); URL warPingURL = new URL("http://localhost:" + getTestData().port + "/simple-war/index.jsp"); assertContainer.start(); PingUtils.assertPingTrue("simple war not started", warPingURL, getLogger()); assertContainer.stop(); PingUtils.assertPingFalse("simple war not stopped", warPingURL, getLogger());
/** * Create the LibertyInstall for this local container * * @param container the container to create it for */ public LibertyInstall(InstalledLocalContainer container) { installDir = new File(container.getHome()); usrDir = new File(container.getConfiguration().getHome()); }
if (-1 != timeout) container.setTimeout(timeout); container.setHome(serverInformation.getContainerHome().getAbsolutePath()); container.setLogger(logger); String[] extraClasspath = serverInformation.getExtraClasspath(); if (extraClasspath != null && extraClasspath.length > 0) container.setExtraClasspath(extraClasspath); container.start();
container.setHome(installer.getHome()); container.setSystemProperties(sysProps); container.setLogger(log); container.start(); long globalDurationSeconds = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - globalStartTime);
if (container.getExtraClasspath() != null && container.getExtraClasspath().length != 0) for (String classpathElement : container.getExtraClasspath()) if (container.getSharedClasspath() != null && container.getSharedClasspath().length != 0) for (String classpathElement : container.getSharedClasspath()) + " supported with expanded deployables on " + container.getId(), this.getClass().getName()); return originalDeployable;
if (container.getExtraClasspath() != null && container.getExtraClasspath().length > 0) for (String extraClasspathElement : container.getExtraClasspath())
/** * Check if resource is deployed as module. * @param container WildFly installed local container. * @param jarFile JAR resource representing module. * @return true if module representing this dependency is already deployed */ public static boolean isModuleDeployed(InstalledLocalContainer container, String jarFile) { FileHandler fileHandler = container.getFileHandler(); String moduleArtifactName = getModuleArtifactName(jarFile, fileHandler); String folder = container.getHome() + "/modules/org/codehaus/cargo/classpath/" + moduleArtifactName + "/main"; if (fileHandler.exists(folder)) { return true; } return false; }
String classJarFile = null; for (String classpathElement : container.getExtraClasspath()) for (String classpathElement : container.getSharedClasspath())
String containerName = container.getName(); if (containerName.startsWith("WildFly 10.") || containerName.startsWith("JBoss EAP 7.0")) String customConfigurationXML = getFileHandler().append(getHome(), configurationXmlFile); String defaultConfigurationXML = getFileHandler().append(container.getHome(), defaultConfigurationXmlFile); String tempFile = getFileHandler().append(getHome(), configurationXmlFile + ".temp");
if (installedLocalContainer.getSystemProperties() != null) : installedLocalContainer.getSystemProperties().entrySet()) String[] classPath = installedContainer.getExtraClasspath(); if (classPath != null)