Package net.minecraft.server.dedicated
Class ServerMBean
java.lang.Object
net.minecraft.server.dedicated.ServerMBean
- All Implemented Interfaces:
DynamicMBean
public final class ServerMBean extends Object implements DynamicMBean
A dynamic management object for a Minecraft Server.
It exposes the average tick time and the historical tick times of the Minecraft Server.
- See Also:
DynamicMBean
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
ServerMBean.Entry
Represents a read-only attribute of the server MBean. -
Field Summary
Fields Modifier and Type Field Description private MBeanInfo
beanInfo
private Map<String,ServerMBean.Entry>
entries
private static Logger
LOGGER
private MinecraftServer
server
-
Constructor Summary
Constructors Modifier Constructor Description private
ServerMBean(MinecraftServer server)
-
Method Summary
Modifier and Type Method 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)
-
Field Details
-
LOGGER
-
server
-
beanInfo
-
entries
-
-
Constructor Details
-
ServerMBean
-
-
Method Details
-
register
Registers a dynamic MBean for a Minecraft Server.- Parameters:
server
- the server to have the MBean
-
getAverageTickTime
private float getAverageTickTime()Returns the server's current average tick time, in milliseconds. -
getTickTimes
private long[] getTickTimes()Returns the server's historical tick times, in milliseconds. -
getAttribute
- Specified by:
getAttribute
in interfaceDynamicMBean
-
setAttribute
- Specified by:
setAttribute
in interfaceDynamicMBean
-
getAttributes
- Specified by:
getAttributes
in interfaceDynamicMBean
-
setAttributes
- Specified by:
setAttributes
in interfaceDynamicMBean
-
invoke
- Specified by:
invoke
in interfaceDynamicMBean
-
getMBeanInfo
- Specified by:
getMBeanInfo
in interfaceDynamicMBean
-