public class JmxFeed extends AbstractFeed
SoftwareProcessImpl
):
private JmxFeed feed;
//@Override
protected void connectSensors() {
super.connectSensors();
feed = JmxFeed.builder()
.entity(this)
.period(500, TimeUnit.MILLISECONDS)
.pollAttribute(new JmxAttributePollConfig<Integer>(ERROR_COUNT)
.objectName(requestProcessorMbeanName)
.attributeName("errorCount"))
.pollAttribute(new JmxAttributePollConfig<Boolean>(SERVICE_UP)
.objectName(serverMbeanName)
.attributeName("Started")
.onError(Functions.constant(false)))
.build();
}
{@literal @}Override
protected void disconnectSensors() {
super.disconnectSensors();
if (feed != null) feed.stop();
}
Modifier and Type | Class and Description |
---|---|
static class |
JmxFeed.Builder |
AbstractEntityAdjunct.AdjunctTagSupport
BrooklynObject.TagSupport
Configurable.ConfigurationSupport
BrooklynObjectInternal.ConfigurationSupportInternal
Modifier and Type | Field and Description |
---|---|
static ConfigKey<com.google.common.collect.SetMultimap<java.lang.String,JmxAttributePollConfig<?>>> |
ATTRIBUTE_POLLS |
static ConfigKey<JmxHelper> |
HELPER |
static ConfigKey<java.lang.Long> |
JMX_CONNECTION_TIMEOUT |
static long |
JMX_CONNECTION_TIMEOUT_MS |
static ConfigKey<java.lang.String> |
JMX_URI |
static org.slf4j.Logger |
log |
static ConfigKey<com.google.common.collect.SetMultimap<javax.management.NotificationFilter,JmxNotificationSubscriptionConfig<?>>> |
NOTIFICATION_SUBSCRIPTIONS |
static ConfigKey<com.google.common.collect.SetMultimap<java.util.List<?>,JmxOperationPollConfig<?>>> |
OPERATION_POLLS |
static ConfigKey<java.lang.Boolean> |
OWN_HELPER |
ONLY_IF_SERVICE_UP
Constructor and Description |
---|
JmxFeed()
For rebind; do not call directly; use builder
|
Modifier and Type | Method and Description |
---|---|
static JmxFeed.Builder |
builder() |
java.lang.String |
getJmxUri() |
void |
setEntity(EntityLocal entity) |
java.lang.String |
toString() |
destroy, getEntity, getRebindSupport, isActivated, isActive, isRunning, isSuspended, resume, start, stop, suspend
config, configure, getAllConfig, getConfig, getConfigMap, getDisplayName, getName, getUniqueTag, isDestroyed, setConfig, setDisplayName, setName, tags
getCatalogItemId, getId, getManagementContext, getTagSupport, init, rebind, setCatalogItemId, setManagementContext
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getName, getUniqueTag, isDestroyed
getCatalogItemId, getDisplayName, getTagSupport, tags
config, setConfig
setCatalogItemId
public static final org.slf4j.Logger log
public static final long JMX_CONNECTION_TIMEOUT_MS
public static final ConfigKey<java.lang.Boolean> OWN_HELPER
public static final ConfigKey<java.lang.String> JMX_URI
public static final ConfigKey<java.lang.Long> JMX_CONNECTION_TIMEOUT
public static final ConfigKey<com.google.common.collect.SetMultimap<java.lang.String,JmxAttributePollConfig<?>>> ATTRIBUTE_POLLS
public static final ConfigKey<com.google.common.collect.SetMultimap<java.util.List<?>,JmxOperationPollConfig<?>>> OPERATION_POLLS
public static final ConfigKey<com.google.common.collect.SetMultimap<javax.management.NotificationFilter,JmxNotificationSubscriptionConfig<?>>> NOTIFICATION_SUBSCRIPTIONS
public static JmxFeed.Builder builder()
public void setEntity(EntityLocal entity)
setEntity
in class AbstractFeed
public java.lang.String getJmxUri()
public java.lang.String toString()
toString
in class AbstractEntityAdjunct