/** * Constructs an {@link AbstractRemoteApplicationBuilder} for a specified * {@link RemotePlatform}. * * @param platform the {@link RemotePlatform} */ public AbstractRemoteApplicationBuilder(RemotePlatform platform) { super(platform); // by default there are no custom remote environment variables remoteEnvironmentVariablesBuilder = new PropertiesBuilder(); }
/** * A helper to construct a {@link PropertiesBuilder} based on the * operating system environment variables defined for the * currently executing process. * * @return a {@link PropertiesBuilder} */ public static PropertiesBuilder fromCurrentEnvironmentVariables() { return new PropertiesBuilder(System.getenv()); }
/** * Constructs an {@link AbstractApplicationSchema}. * * @param executableName the name of the executable for the {@link Application}s * produced from this {@link ApplicationSchema} */ public AbstractApplicationSchema(String executableName) { m_executableName = executableName; m_propertiesBuilder = new PropertiesBuilder(); m_applicationArguments = new ArrayList<String>(); m_isErrorStreamRedirected = false; m_isDiagnosticsEnabled = false; m_defaultTimeout = 1; m_defaultTimeoutUnits = TimeUnit.MINUTES; m_isEnvironmentInherited = true; m_lifecycleInterceptors = new LinkedList<LifecycleEventInterceptor<A>>(); }
/** * A helper to construct a {@link PropertiesBuilder} based on the * properties defined in the specified Java properties file. * * @param fileName the name of the file (including path if required) from * which to load the properties * * @return a {@link PropertiesBuilder} * * @throws IOException should a problem occur while loading the properties */ public static PropertiesBuilder fromPropertiesFile(String fileName) throws IOException { Properties properties = new Properties(); URL url = ClassLoader.getSystemResource(fileName); properties.load(url.openStream()); return new PropertiesBuilder(properties); }
/** * A helper to construct a {@link PropertiesBuilder} based on the * non-standard Java system properties, ie: those that aren't in the set * {@link #STANDARD_SYSTEM_PROPERTIES}, defined by the currently * executing process. * * @return a {@link PropertiesBuilder} * * @see #STANDARD_SYSTEM_PROPERTIES */ public static PropertiesBuilder fromCurrentNonStandardSystemProperties() { // grab a copy of the current system properties Properties systemProperties = System.getProperties(); // filter out the standard system properties Properties properties = new Properties(); for (String propertyName : systemProperties.stringPropertyNames()) { if (!STANDARD_SYSTEM_PROPERTIES.contains(propertyName)) { properties.put(propertyName, systemProperties.get(propertyName)); } } // return a builder of the filtered properties return new PropertiesBuilder(properties); }
/** * Construct a {@link JavaApplicationSchema}. * * @param executableName The executable name to run * @param applicationClassName The fully qualified class name of the Java application. * @param classPath The class path for the Java application. */ public AbstractJavaApplicationSchema(String executableName, String applicationClassName, String classPath) { super(executableName); m_applicationClassName = applicationClassName; m_classPath = new ClassPath(classPath); m_jvmOptions = new ArrayList<String>(); m_systemPropertiesBuilder = new PropertiesBuilder(); configureDefaults(); }