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
visitor
quickly 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
→ServerInfo
MonitorImpl.MutableConnectionInfo
→ConnectionInfo
MonitorImpl.MutableStatementInfo
→StatementInfo
MonitorImpl.MutableExecutionInfo
→ExecutionInfo
MonitorImpl.MutableSqlStatementInfo
→SqlStatementInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
MonitorImpl.Command
A kind of message that produces a response.(package private) static interface
MonitorImpl.CommandVisitor<T>
Extension toVisitor
to allow commands as well as events.(package private) static class
MonitorImpl.ConnectionsCommand
(package private) static class
MonitorImpl.ServerCommand
(package private) static class
MonitorImpl.ShutdownCommand
(package private) static class
MonitorImpl.SqlStatementsCommand
(package private) static class
MonitorImpl.StatementsCommand
-
Field Summary
Fields Modifier and Type Field Description protected static Util.MemoryInfo
MEMORY_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()
ServerInfo
getServer()
List<SqlStatementInfo>
getSqlStatements()
List<StatementInfo>
getStatements()
void
sendEvent(Event event)
Sends an event to the monitor.void
shutdown()
-
-
-
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:Monitor
Sends an event to the monitor.
-
getServer
public ServerInfo getServer()
- Specified by:
getServer
in interfaceMonitor
- Specified by:
getServer
in interfaceMonitorMXBean
-
getConnections
public List<ConnectionInfo> getConnections()
- Specified by:
getConnections
in interfaceMonitor
- Specified by:
getConnections
in interfaceMonitorMXBean
-
getStatements
public List<StatementInfo> getStatements()
- Specified by:
getStatements
in interfaceMonitor
- Specified by:
getStatements
in interfaceMonitorMXBean
-
getSqlStatements
public List<SqlStatementInfo> getSqlStatements()
- Specified by:
getSqlStatements
in interfaceMonitor
- Specified by:
getSqlStatements
in interfaceMonitorMXBean
-
-