public final class ServerMBean extends Object implements DynamicMBean
It exposes the average tick time and the historical tick times of the Minecraft Server.
DynamicMBean
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ServerMBean.Entry
Represents a read-only attribute of the server MBean.
|
Modifier and Type | Field and Description |
---|---|
private MBeanInfo |
beanInfo |
private Map<String,ServerMBean.Entry> |
entries |
private static Logger |
LOGGER |
private MinecraftServer |
server |
Modifier | Constructor and Description |
---|---|
private |
ServerMBean(MinecraftServer server) |
Modifier and Type | Method and Description |
---|---|
Object |
getAttribute(String attribute) |
AttributeList |
getAttributes(String[] attributes) |
private float |
getAverageTickTime()
Returns the server's current average tick time, in milliseconds.
|
MBeanInfo |
getMBeanInfo() |
private long[] |
getTickTimes()
Returns the server's historical tick times, in milliseconds.
|
Object |
invoke(String actionName,
Object[] params,
String[] signature) |
static void |
register(MinecraftServer server)
Registers a dynamic MBean for a Minecraft Server.
|
void |
setAttribute(Attribute attribute) |
AttributeList |
setAttributes(AttributeList attributes) |
private static final Logger LOGGER
private final MinecraftServer server
private final MBeanInfo beanInfo
private final Map<String,ServerMBean.Entry> entries
private ServerMBean(MinecraftServer server)
public static void register(MinecraftServer server)
server
- the server to have the MBeanprivate float getAverageTickTime()
private long[] getTickTimes()
@Nullable public Object getAttribute(String attribute)
getAttribute
in interface DynamicMBean
public void setAttribute(Attribute attribute)
setAttribute
in interface DynamicMBean
public AttributeList getAttributes(String[] attributes)
getAttributes
in interface DynamicMBean
public AttributeList setAttributes(AttributeList attributes)
setAttributes
in interface DynamicMBean
@Nullable public Object invoke(String actionName, Object[] params, String[] signature)
invoke
in interface DynamicMBean
public MBeanInfo getMBeanInfo()
getMBeanInfo
in interface DynamicMBean