public class Facultative extends java.lang.Object implements FacultativeMBean, AgentRegistry<BooleanConsumer>
Modifier and Type | Field and Description |
---|---|
private java.util.Set<BooleanConsumer> |
agents
agent's set
|
private java.lang.String |
annotation
MBean annotation
|
private java.util.concurrent.atomic.AtomicBoolean |
enabled
"MBean enabled flag
|
Constructor and Description |
---|
Facultative() |
Modifier and Type | Method and Description |
---|---|
void |
enable(boolean val)
Enable/disable
|
java.lang.String |
getAnnotation()
Get counter annotation
|
boolean |
isEnabled()
Check if enabled
|
void |
register(BooleanConsumer agent)
Register agent
|
void |
setAnnotation(java.lang.String annotation)
Set counter annotation
|
private final java.util.Set<BooleanConsumer> agents
private final java.util.concurrent.atomic.AtomicBoolean enabled
private java.lang.String annotation
public boolean isEnabled()
isEnabled
in interface FacultativeMBean
true
if enabledpublic void enable(boolean val)
enable
in interface FacultativeMBean
val
- new value of the "enabled" flag.public void register(BooleanConsumer agent)
register
in interface AgentRegistry<BooleanConsumer>
agent
- agent to be registeredpublic java.lang.String getAnnotation()
getAnnotation
in interface FacultativeMBean
public void setAnnotation(java.lang.String annotation)
setAnnotation
in interface FacultativeMBean
annotation
- counter annotation