/** * Obtains the underlying {@link com.oracle.tools.runtime.ApplicationProcess} that controls the * {@link Application}. * * @return the {@link com.oracle.tools.runtime.ApplicationProcess} for the {@link Application} */ P getJavaProcess() { return super.getApplicationProcess(); }
/** * Adds the properties defined by the {@link PropertiesBuilder} to this {@link JavaApplicationSchema}. * * @param systemProperties The system {@link PropertiesBuilder} * @return the {@link JavaApplicationSchema} */ @SuppressWarnings("unchecked") public S setSystemProperties(PropertiesBuilder systemProperties) { m_systemPropertiesBuilder.addProperties(systemProperties); return (S) this; }
/** * Determines if a {@link JavaApplication} will run in a "headless" mode. * * @return the {@link JavaApplicationSchema} * * @see JavaApplication#JAVA_AWT_HEADLESS */ public boolean isHeadless() { Object value = m_systemPropertiesBuilder.getProperty(JAVA_AWT_HEADLESS); return value instanceof Boolean && ((Boolean) value); } }
/** * Create a {@link SimpleApplicationSchema} to execute the Vagrant * command line. * * @return a {@link SimpleApplicationSchema} to execute the Vagrant * command line */ protected SimpleApplicationSchema instantiateSchema() { return new SimpleApplicationSchema(vagrantCommand).setWorkingDirectory(vagrantFile); }
/** * Constructs a {@link Property} based on another {@link Property}. * * @param property the {@link Property} from which to construct * (copy) the new {@link Property} */ public Property(Property property) { this.name = property.getName(); this.value = property.getValue(); this.defaultValue = property.getDefaultValue(); }
/** * Sets the specified environment variable to the specified value. * * @param name the name of the environment variable * @param value the value of the environment variable * * @return the {@link ApplicationSchema} (so that we can perform method chaining) */ @SuppressWarnings("unchecked") public S setEnvironmentVariable(String name, Object value) { m_propertiesBuilder.setProperty(name, value); return (S) this; }
/** * 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(); }
/** * Creates a new {@link Properties} instance containing name, value pairs * defined by the {@link PropertiesBuilder}. * <p> * If a property with in the {@link PropertiesBuilder} is defined as an * {@link Iterator}, the next value from the said {@link Iterator} is used * as a value for the property. * * @return a new {@link Properties} instance as defined by the {@link PropertiesBuilder} */ public Properties realize() { return realize(null); }
/** * Constructs a {@link PropertiesBuilder} based on the properties defined * in another {@link PropertiesBuilder}. * * @param propertiesBuilder the {@link PropertiesBuilder} on which to base * the new {@link PropertiesBuilder} */ public PropertiesBuilder(PropertiesBuilder propertiesBuilder) { this(); for (String name : propertiesBuilder.getPropertyNames()) { this.properties.put(name, new Property(propertiesBuilder.properties.get(name))); } }
@Override public int exitValue() { return m_process.exitValue(); }
/** * Clears the currently registered environment variables from the * {@link ApplicationBuilder}. * * @return the {@link ApplicationSchema} (so that we can perform method chaining) */ @SuppressWarnings("unchecked") public S clearEnvironmentVariables() { m_propertiesBuilder.clear(); return (S) this; }
@Override public String getRemoteCommandToExecute() { return schema.getExecutableName(); }
@Override public List<String> getRemoteCommandArguments(InetAddress remoteExecutorAddress) { return schema.getArguments(); }
@Override public long getId() { return m_process.getId(); }
@Override public int waitFor() throws InterruptedException { return m_process.waitFor(); }
/** * Adds an argument to use when starting the {@link Application}. * * @param argument the argument for the {@link Application} * * @return the {@link ApplicationSchema} (so that we can perform method chaining) */ @SuppressWarnings("unchecked") public S setArgument(String argument) { addArgument(argument); return (S) this; }
/** * Optionally sets the specified system property. * * @param name the name of the system property * @param value the value for the system property * * @return the {@link JavaApplicationSchema} */ @SuppressWarnings("unchecked") public S setSystemPropertyIfAbsent(String name, Object value) { m_systemPropertiesBuilder.setPropertyIfAbsent(name, value); return (S) this; }
/** * Sets the specified system property. * * @param name The name of the system property * @param value The value for the system property * @return the {@link JavaApplicationSchema} */ @SuppressWarnings("unchecked") public S setSystemProperty(String name, Object value) { m_systemPropertiesBuilder.setProperty(name, value); return (S) this; }
/** * Defines a custom environment variable for remote {@link Application}s * realized by this {@link RemoteApplicationBuilder} based on values * returned by the {@link Iterator}. * * @param name the name of the environment variable * @param iterator an {@link Iterator} providing values for the environment * variable * * @return this {@link RemoteApplicationBuilder} to permit fluent method calls */ public B setEnvironmentVariable(String name, Iterator<?> iterator) { remoteEnvironmentVariablesBuilder.setProperty(name, iterator); return (B) this; }
/** * Defines a custom environment variable for remote {@link Application}s * realized by this {@link RemoteApplicationBuilder}. * * @param name the name of the environment variable * @param value the value of the environment variable * * @return this {@link RemoteApplicationBuilder} to permit fluent method calls */ public B setEnvironmentVariable(String name, Object value) { remoteEnvironmentVariablesBuilder.setProperty(name, value); return (B) this; }