brooklyn.event.feed.function.FunctionPollConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of brooklyn-core Show documentation
Show all versions of brooklyn-core Show documentation
Entity implementation classes, events, and other core elements
package brooklyn.event.feed.function;
import static com.google.common.base.Preconditions.checkNotNull;
import groovy.lang.Closure;
import java.util.concurrent.Callable;
import brooklyn.event.AttributeSensor;
import brooklyn.event.feed.PollConfig;
import brooklyn.util.GroovyJavaMethods;
public class FunctionPollConfig extends PollConfig> {
private Callable> callable;
public FunctionPollConfig(AttributeSensor sensor) {
super(sensor);
}
public FunctionPollConfig(FunctionPollConfig other) {
super(other);
callable = other.callable;
}
public Callable extends Object> getCallable() {
return callable;
}
public FunctionPollConfig callable(Callable extends S> val) {
this.callable = checkNotNull(val, "callable");
return this;
}
public FunctionPollConfig closure(Closure> val) {
this.callable = GroovyJavaMethods.callableFromClosure(checkNotNull(val, "closure"));
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy