public abstract class AbstractCommandFeed extends AbstractFeed
private AbstractCommandFeed feed;
//@Override
protected void connectSensors() {
super.connectSensors();
feed = SshFeed.builder()
.entity(this)
.machine(mySshMachineLachine)
.poll(new CommandPollConfig<Boolean>(SERVICE_UP)
.command("rabbitmqctl -q status")
.onSuccess(new Function<SshPollValue, Boolean>() {
public Boolean apply(SshPollValue input) {
return (input.getExitStatus() == 0);
}}))
.build();
}
{@literal @}Override
protected void disconnectSensors() {
super.disconnectSensors();
if (feed != null) feed.stop();
}
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCommandFeed.Builder<T extends AbstractCommandFeed,B extends AbstractCommandFeed.Builder<T,B>> |
AbstractEntityAdjunct.AdjunctTagSupport, AbstractEntityAdjunct.BasicSubscriptionSupport
BrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal
Modifier and Type | Field and Description |
---|---|
static ConfigKey<java.lang.Boolean> |
EXEC_AS_COMMAND |
static org.slf4j.Logger |
log |
static ConfigKey<com.google.common.base.Supplier<MachineLocation>> |
MACHINE |
static ConfigKey<com.google.common.collect.SetMultimap<org.apache.brooklyn.feed.AbstractCommandFeed.CommandPollIdentifier,CommandPollConfig<?>>> |
POLLS |
ONLY_IF_SERVICE_UP
Constructor and Description |
---|
AbstractCommandFeed()
For rebind; do not call directly; use builder
|
destroy, getEntity, getRebindSupport, isActivated, isRunning, isSuspended, relations, resume, setEntity, start, stop, suspend
config, configure, getAdjunctType, getConfig, getDisplayName, getUniqueTag, isDestroyed, setConfig, setDisplayName, subscribe, subscribeToChildren, subscribeToMembers, subscriptions, tags, toString, unsubscribe, unsubscribe
getCatalogItemId, getId, getManagementContext, init, rebind, setCatalogItemId, setManagementContext
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getUniqueTag, isDestroyed
getCatalogItemId, getDisplayName, subscriptions, tags
config, getConfig, setConfig
setCatalogItemId
public static final org.slf4j.Logger log
public static final ConfigKey<com.google.common.base.Supplier<MachineLocation>> MACHINE
public static final ConfigKey<java.lang.Boolean> EXEC_AS_COMMAND
public static final ConfigKey<com.google.common.collect.SetMultimap<org.apache.brooklyn.feed.AbstractCommandFeed.CommandPollIdentifier,CommandPollConfig<?>>> POLLS