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, AbstractEntityAdjunct.BasicSubscriptionSupportBrooklynObject.RelationSupport<T extends BrooklynObject>, BrooklynObject.SubscriptionSupport, BrooklynObject.TagSupportConfigurable.ConfigurationSupportBrooklynObjectInternal.ConfigurationSupportInternal, BrooklynObjectInternal.RelationSupportInternal<T extends BrooklynObject>, BrooklynObjectInternal.SubscriptionSupportInternal| Modifier and Type | Field and Description |
|---|---|
static ConfigKey<<any>> |
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<<any>> |
NOTIFICATION_SUBSCRIPTIONS |
static ConfigKey<<any>> |
OPERATION_POLLS |
static ConfigKey<java.lang.Boolean> |
OWN_HELPER |
ONLY_IF_SERVICE_UPHIGHLIGHT_NAME_LAST_ACTION, HIGHLIGHT_NAME_LAST_CONFIRMATION, HIGHLIGHT_NAME_LAST_VIOLATION, HIGHLIGHT_NAME_TRIGGERS| 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, isRunning, isSuspended, relations, resume, start, stop, suspendconfig, configure, getAdjunctType, getConfig, getDisplayName, getExecutionContext, getHighlights, getManagementContext, getUniqueTag, isDestroyed, setDisplayName, setHighlights, subscriptions, tagsaddSearchPath, getCatalogItemId, getCatalogItemIdSearchPath, getId, init, rebind, setCatalogItemId, setCatalogItemIdAndSearchPath, setManagementContext, stackCatalogItemIdequals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetHighlights, getId, getUniqueTag, isDestroyedgetCatalogItemId, getCatalogItemIdSearchPath, getDisplayName, subscriptions, tagsconfig, getConfigaddSearchPath, setCatalogItemId, setCatalogItemIdAndSearchPath, stackCatalogItemIdpublic 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<<any>> ATTRIBUTE_POLLS
public static final ConfigKey<<any>> OPERATION_POLLS
public static final ConfigKey<<any>> NOTIFICATION_SUBSCRIPTIONS
public static JmxFeed.Builder builder()
public void setEntity(EntityLocal entity)
setEntity in class AbstractFeedpublic java.lang.String getJmxUri()
public java.lang.String toString()
toString in class AbstractEntityAdjunct