@ThreadSafe public abstract class StatsHolder extends NotificationBroadcasterSupport implements StatsHolderMBean, StatsOwner
Base class for MBeans holding Stats.
| Modifier and Type | Class and Description |
|---|---|
static class |
StatsHolder.UpdateNotification
Update notification.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTIVATOR_CLASS_NAME_SUFFIX
Activator class name suffix.
|
static String |
DEFAULT_DOMAIN
Default domain.
|
static String |
DOMAIN_PROPERTY
Domain property.
|
protected static String |
NAME_KEY
JMX name key.
|
static String |
STATS_UPDATE_TYPE
Stats update type.
|
protected static String |
TYPE_KEY
JMX type key.
|
| Constructor and Description |
|---|
StatsHolder() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getDefaultDomain()
Gets the default JMX domain.
|
ObjectName |
getObjectName()
Gets the object name.
|
Optional<String> |
getObjectVersion()
Gets the object's version.
|
protected abstract Optional<? extends Stats> |
getStats()
Gets the stats.
|
String[] |
getStatsStrings()
Gets the stats strings.
|
protected Logger |
getThisLogger()
Gets the logger.
|
ObjectName |
makeObjectName(Optional<String> nameValue)
Makes an object name.
|
static ObjectName |
makeObjectName(String domain,
String typeValue,
Optional<String> nameValue)
Makes an object name.
|
protected Optional<ObjectName> |
objectName()
Returns the object name.
|
void |
onStatsUpdated()
Called when the stats are updated.
|
void |
setObjectName(ObjectName objectName)
Sets the object name.
|
abstract void |
updateStats()
Updates the stats.
|
public static final String ACTIVATOR_CLASS_NAME_SUFFIX
public static final String DEFAULT_DOMAIN
public static final String DOMAIN_PROPERTY
public static final String STATS_UPDATE_TYPE
protected static final String NAME_KEY
protected static final String TYPE_KEY
@Nonnull @CheckReturnValue public static String getDefaultDomain()
@Nonnull
@CheckReturnValue
public static ObjectName makeObjectName(@Nonnull
String domain,
@Nonnull
String typeValue,
@Nonnull
Optional<String> nameValue)
domain - The object's domain.typeValue - The value for the 'type' key.nameValue - The value for the 'name' key (optional).public ObjectName getObjectName()
getObjectName in interface StatsOwnerpublic Optional<String> getObjectVersion()
getObjectVersion in interface StatsOwnerpublic final String[] getStatsStrings()
getStatsStrings in interface StatsHolderMBean@Nonnull
@CheckReturnValue
public ObjectName makeObjectName(@Nonnull
Optional<String> nameValue)
nameValue - The value for the 'name' key (optional).public final void onStatsUpdated()
onStatsUpdated in interface StatsOwnerpublic final void setObjectName(@Nonnull
ObjectName objectName)
objectName - The object name.public abstract void updateStats()
updateStats in interface StatsOwner@Nonnull @CheckReturnValue protected abstract Optional<? extends Stats> getStats()
@Nonnull @CheckReturnValue protected final Logger getThisLogger()
@Nonnull @CheckReturnValue protected final Optional<ObjectName> objectName()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.