Package mondrian.server
Class MonitorImpl
- java.lang.Object
-
- mondrian.server.MonitorImpl
-
- All Implemented Interfaces:
Monitor,MonitorMXBean
class MonitorImpl extends Object implements Monitor, MonitorMXBean
Process that reads from the monitor stream and updates counters.Internally, uses a dedicated thread to process events. Events received from log4j are placed on a queue. This "Active object" or "Actor" pattern means that the data structures that hold counters do not need to be locked.
Command requests are treated like events. They place their result on a result queue.
A
visitorquickly dispatches events and commands to the appropriate handler method.The monitored objects form a hierarchy. For each object type, there is a mutable workspace (whose members are private and non-final) that is converted into a monitor object (whose members are public and final) when its
fix()method is called:MonitorImpl.MutableServerInfo→ServerInfoMonitorImpl.MutableConnectionInfo→ConnectionInfoMonitorImpl.MutableStatementInfo→StatementInfoMonitorImpl.MutableExecutionInfo→ExecutionInfoMonitorImpl.MutableSqlStatementInfo→SqlStatementInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classMonitorImpl.CommandA kind of message that produces a response.(package private) static interfaceMonitorImpl.CommandVisitor<T>Extension toVisitorto allow commands as well as events.(package private) static classMonitorImpl.ConnectionsCommand(package private) static classMonitorImpl.ServerCommand(package private) static classMonitorImpl.ShutdownCommand(package private) static classMonitorImpl.SqlStatementsCommand(package private) static classMonitorImpl.StatementsCommand
-
Field Summary
Fields Modifier and Type Field Description protected static Util.MemoryInfoMEMORY_INFO
-
Constructor Summary
Constructors Constructor Description MonitorImpl()Creates a Monitor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ConnectionInfo>getConnections()ServerInfogetServer()List<SqlStatementInfo>getSqlStatements()List<StatementInfo>getStatements()voidsendEvent(Event event)Sends an event to the monitor.voidshutdown()
-
-
-
Field Detail
-
MEMORY_INFO
protected static final Util.MemoryInfo MEMORY_INFO
-
-
Method Detail
-
shutdown
public void shutdown()
-
sendEvent
public void sendEvent(Event event)
Description copied from interface:MonitorSends an event to the monitor.
-
getServer
public ServerInfo getServer()
- Specified by:
getServerin interfaceMonitor- Specified by:
getServerin interfaceMonitorMXBean
-
getConnections
public List<ConnectionInfo> getConnections()
- Specified by:
getConnectionsin interfaceMonitor- Specified by:
getConnectionsin interfaceMonitorMXBean
-
getStatements
public List<StatementInfo> getStatements()
- Specified by:
getStatementsin interfaceMonitor- Specified by:
getStatementsin interfaceMonitorMXBean
-
getSqlStatements
public List<SqlStatementInfo> getSqlStatements()
- Specified by:
getSqlStatementsin interfaceMonitor- Specified by:
getSqlStatementsin interfaceMonitorMXBean
-
-