Refine search
/** * Copies the container configuration (found through {@link #getConfiguration()}) to the logging * directory specified by {@link #logDir} */ public void cleanUp() throws IOException { File configDir = new File(getConfiguration().getHome()); if (configDir.exists()) { logger.info("Deleting configuration folder {}", configDir.getAbsolutePath()); FileUtils.deleteDirectory(configDir); } }
/** * The container's port for the specified port type */ public String getPort(String portType) { LocalConfiguration config = getConfiguration(); config.applyPortOffset(); if (!container.getState().isStarted()) throw new IllegalStateException( "Container is not started, thus a port has not yet been assigned to the container."); return config.getPropertyValue(portType); }
/** * Deploys the {@link #warFile} to the cargo container ({@link #container}). */ public void deployWar() { // Get the cargo war from the war file WAR war = new WAR(warFile.getAbsolutePath()); // Set context access to nothing war.setContext(""); // Deploy the war the container's configuration getConfiguration().addDeployable(war); logger.info("Deployed WAR file at {}", war.getFile()); }
new Object[] {new Integer(getConfiguration().getPropertyValue( ServletPropertySet.PORT))}); new File(getConfiguration().getHome(), "etc/webdefault.xml").toURI().toString(); for (Deployable deployable : getConfiguration().getDeployables()) new Object[] {"/cargocpc", new File(getConfiguration().getHome(), "cargocpc.war").getPath()});
@Override protected void addConfigurationScriptProperties(Map<String, String> propertiesMap) { LocalConfiguration configuration = (LocalConfiguration) getConfiguration(); String domainName = configuration.getFileHandler().getName(configuration.getHome()); propertiesMap.put("cargo.weblogic.domain.name", domainName); }
protected void setSecurityRealm() throws Exception if (getConfiguration().getUsers() != null && !getConfiguration().getUsers().isEmpty()) realmClass.getConstructor(new Class[] {String.class}).newInstance( new Object[] { getConfiguration().getPropertyValue(JettyPropertySet.REALM_NAME)}); Method putUser = realmClass.getMethod("putUser", new Class[] {java.lang.String.class, credentialClass, java.lang.String[].class}); for (User user : getConfiguration().getUsers()) String etcDir = getFileHandler().append(getConfiguration().getHome(), "etc"); JettyUtils.createRealmFile( getConfiguration().getUsers(), etcDir, getFileHandler()); this.defaultRealm = realmClass.getConstructor(new Class[] {String.class, String.class}) .newInstance(new Object[] { getConfiguration().getPropertyValue(JettyPropertySet.REALM_NAME), getFileHandler().append(etcDir, "cargo-realm.properties")});
/** * {@inheritDoc}. For Tomcat this is the <code>webapps</code> directory. */ @Override public String getDeployableDir(Deployable deployable) { return getFileHandler().append(getContainer().getConfiguration().getHome(), getContainer().getConfiguration().getPropertyValue( TomcatPropertySet.WEBAPPS_DIRECTORY)); }
/** * Convenience method for retrieving the {@link LocalConfiguration}'s property value. * @param propertyName the property we want the value of. * @return the value of the named property. */ private String getPropertyValue(String propertyName) { return configuration.getPropertyValue(propertyName); }
/** * {@inheritDoc}. CARGO-1255: Remove the JVM arguments from the asadmin, else debugging and * potentially many other functions do work. */ @Override protected void startInternal() throws Exception { synchronized (this.getConfiguration()) { String jvmArguments = this.getConfiguration().getPropertyValue(GeneralPropertySet.JVMARGS); try { this.getConfiguration().getProperties().remove(GeneralPropertySet.JVMARGS); super.startInternal(); } finally { if (jvmArguments != null) { this.getConfiguration().setProperty(GeneralPropertySet.JVMARGS, jvmArguments); } } } }
if (!getConfiguration().getUsers().isEmpty()) getConfiguration().getPropertyValue(JettyPropertySet.REALM_NAME)}); for (User user : getConfiguration().getUsers())
/** * {@inheritDoc} */ @Override protected void doStart(JvmLauncher java) throws Exception { this.getLogger().debug("Starting container " + getName(), this.getClass().getName()); java.setJarFile(new File(getConfiguration().getHome(), "bin/server.jar")); java.setSystemProperty("org.apache.geronimo.server.dir", getConfiguration().getHome()); java.setSystemProperty("java.io.tmpdir", new File(getConfiguration().getHome(), "/var/temp").getPath()); java.start(); waitForCompletion(true); // deploy scheduled deployables GeronimoInstalledLocalDeployer deployer = new GeronimoInstalledLocalDeployer(this); for (Deployable deployable : this.getConfiguration().getDeployables()) { deployer.redeploy(deployable); } }
getConfiguration().getPropertyValue(GeneralPropertySet.RMI_PORT)); java.setSystemProperty("org.apache.geronimo.config.substitution.HTTPPort", getConfiguration().getPropertyValue(ServletPropertySet.PORT)); java.setSystemProperty("org.apache.geronimo.config.substitution.EndPointURI", "http://localhost:" + getConfiguration().getPropertyValue(ServletPropertySet.PORT)); configuration.deployDatasources(this); for (Deployable deployable : this.getConfiguration().getDeployables())
List<User> users = getConfiguration().getUsers(); if (!users.isEmpty()) String onlineDeploymentValue = getConfiguration().getPropertyValue( WebSpherePropertySet.ONLINE_DEPLOYMENT); boolean onlineDeployment = Boolean.parseBoolean(onlineDeploymentValue); for (Deployable deployable : getConfiguration().getDeployables()) for (Deployable deployable : getConfiguration().getDeployables()) String scriptPaths = getConfiguration().getPropertyValue( WebSpherePropertySet.JYTHON_SCRIPT_ONLINE); List<String> scriptPathList = ComplexPropertyUtils.parseProperty(scriptPaths, "|");
if (getConfiguration().getDeployables() != null) for (Deployable toDeploy : getConfiguration().getDeployables()) "sshjava.shift." + getFileHandler().getAbsolutePath(toDeploy.getFile()), "deployables/" + new File(toDeploy.getFile()).getName()); java.setSystemProperty("sshjava.shift." + getFileHandler().getAbsolutePath(getHome()), "containers/" + getId()); getConfiguration().getPropertyValue(entry.getValue().toString()));
/** * set the container's logging level */ public void setLoggingLevel(String loggingLevel) { this.loggingLevel = loggingLevel; LocalConfiguration config = getConfiguration(); config.setProperty(GeneralPropertySet.LOGGING, loggingLevel); container.setConfiguration(config); }
/** * Configure resource via property and retrieve the configuration file. * @param fixture Resource fixture. * @return Configuration file for <code>fixture</code>. * @throws Exception If anything goes wrong. */ protected String configureResourceViaPropertyAndRetrieveConfigurationFile( ResourceFixture fixture) throws Exception { configuration.setProperty(ResourcePropertySet.RESOURCE, fixture .buildResourcePropertyString()); ((AbstractStandaloneLocalConfigurationWithXMLConfigurationBuilder) configuration) .parsePropertiesForPendingConfiguration(); ((ResourceSupport) configuration).configureResources(container); return configuration.getFileHandler().readTextFile(getResourceConfigurationFile(fixture), "UTF-8"); }
getTestData().getTestDataFileFor("authentication-war"), DeployableType.WAR); getLocalContainer().getConfiguration().addDeployable(war); getLocalContainer().getConfiguration().getUsers().addAll(users);
deployable.setContext(ctx.getContextPath()); cargoConfig.addDeployable(deployable); cargoConfig.getProperties().putAll(props);
private void dumpConfiguration() { System.out.println("-------------------------------------------"); System.out.println("Configuration for container " + this); System.out.println("-------------------------------------------"); LocalConfiguration configuration = getConfiguration(); System.out.format("Name: %s%n", configuration); System.out.format("Class: %s%n", configuration.getClass()); System.out.println("Properties:"); configuration.getProperties().entrySet().forEach(System.out::println); System.out.println("-------------------------------------------"); System.out.println(""); }