/** * Create a new {@link HttpDeployer}. * * @param options the {@link Option}s controlling this {@link HttpDeployer} */ public HttpDeployer(Option... options) { this.optionsByType = OptionsByType.of(options); }
/** * Obtain the {@link OptionsByType}s for this {@link Argument}. * * @return the {@link OptionsByType}s for this {@link Argument} */ public OptionsByType getOptions() { return OptionsByType.of(options); }
/** * Construct an {@link AbstractPlatform} with the specified name. * * @param name the name of this {@link Platform} * @param options the {@link Option}s for the {@link Platform} */ public AbstractPlatform(String name, Option... options) { super(); this.name = name; this.optionsByType = OptionsByType.of(options); }
/** * Obtain the {@link OptionsByType}s for this {@link Argument}. * * @return the {@link OptionsByType}s for this {@link Argument} */ public OptionsByType getOptions() { return OptionsByType.of(options); }
/** * Obtain the {@link OptionsByType}s for this {@link SystemProperty}. * * @return the {@link OptionsByType}s for this {@link SystemProperty} */ public OptionsByType getOptions() { return OptionsByType.of(options); }
@Override public void with(Option... options) { optionsByType = OptionsByType.of(options); }
/** * Create a new {@link WindowsSession} that connects to the * WinRM service on the specified host. * * @param connection the {@link SoapConnection} to use to send SOAP messages * @param options the {@link com.oracle.bedrock.Option}s controlling the session */ public WindowsSession(SoapConnection connection, Option... options) { this.connection = connection; this.optionsByType = OptionsByType.of(options); }
/** * Constructs an {@link AbstractAssembly} with the specified {@link OptionsByType}. * * @param optionsByType the {@link OptionsByType} for the {@link Assembly} */ public AbstractAssembly(OptionsByType optionsByType) { this.applications = new CopyOnWriteArrayList<>(); this.isClosed = new AtomicBoolean(false); this.discriminators = new ConcurrentHashMap<>(); this.optionsByType = OptionsByType.of(optionsByType); }
/** * Constructs a {@link Caching}. * * @param enabled is caching enabled? * @param options the {@link Option}s for {@link Caching} */ private Caching(boolean enabled, Option... options) { this.enabled = enabled; this.optionsByType = options == null || options.length == 0 ? OptionsByType.empty() : OptionsByType.of(options); }
@Override public Boolean call() { if (runner == null) { runner = JUnitTestRunner.INSTANCE; } runner.run(OptionsByType.of(options)); return true; }
@Override public Platform getPlatform(Option... options) { OptionsByType optionsByType = OptionsByType.of(options); PlatformPredicate predicate = optionsByType.getOrDefault(PlatformPredicate.class, PlatformPredicate.any()); Optional<Platform> platform = platforms.stream().filter(predicate).unordered().findFirst(); return platform.isPresent() ? platform.get() : null; } }
@Override public Platform getPlatform(Option... options) { OptionsByType optionsByType = OptionsByType.of(options); PlatformPredicate predicate = optionsByType.getOrDefault(PlatformPredicate.class, PlatformPredicate.any()); Optional<Platform> platform = platforms.stream().filter(predicate).unordered().findFirst(); return platform.isPresent() ? platform.get() : null; } }
@Override default Platform getPlatform(Option... options) { OptionsByType platformOptions = OptionsByType.of(options); PlatformPredicate predicate = platformOptions.get(PlatformPredicate.class); return predicate.test(this) ? this : null; }
@Override default Platform getPlatform(Option... options) { OptionsByType platformOptions = OptionsByType.of(options); PlatformPredicate predicate = platformOptions.get(PlatformPredicate.class); return predicate.test(this) ? this : null; }
@Override public void removeListener(RemoteEventListener listener, Option... options) { OptionsByType optionsByType = OptionsByType.of(options); StreamName streamName = optionsByType.get(StreamName.class); eventListenersByStreamName.computeIfPresent(streamName, (name, eventListeners) -> { eventListeners.remove(listener); return eventListeners.size() == 0 ? null : eventListeners; }); }
@Override public void removeListener(RemoteEventListener listener, Option... options) { OptionsByType optionsByType = OptionsByType.of(options); StreamName streamName = optionsByType.get(StreamName.class); eventListenersByStreamName.computeIfPresent(streamName, (name, eventListeners) -> { eventListeners.remove(listener); return eventListeners.size() == 0 ? null : eventListeners; }); }
@Override public int waitFor(Option... options) { // include the application specific options for waiting OptionsByType waitForOptions = OptionsByType.of(getOptions().asArray()).addAll(options); return process.waitFor(waitForOptions.asArray()); }
@Override public int waitFor(Option... options) { // include the application specific options for waiting OptionsByType waitForOptions = OptionsByType.of(getOptions().asArray()).addAll(options); return process.waitFor(waitForOptions.asArray()); }
@Override public int waitFor(Option... options) { OptionsByType optionsByType = OptionsByType.of(options); Timeout timeout = optionsByType.get(Timeout.class); DeferredHelper.ensure(eventually(invoking(this).exitValue()), within(timeout)); return exitValue(); } }
@Override public int waitFor(Option... options) { OptionsByType optionsByType = OptionsByType.of(options); Timeout timeout = optionsByType.get(Timeout.class); DeferredHelper.ensure(eventually(invoking(this).exitValue()), within(timeout)); return exitValue(); } }