mondrian.server
Class MonitorImpl

java.lang.Object
  extended by mondrian.server.MonitorImpl
All Implemented Interfaces:
Monitor

 class MonitorImpl
extends Object
implements Monitor

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:


Nested Class Summary
(package private) static class MonitorImpl.Command
          A kind of message that produces a response.
(package private) static interface MonitorImpl.CommandVisitor<T>
          Extension to Visitor 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
protected static Util.MemoryInfo MEMORY_INFO
           
 
Constructor Summary
MonitorImpl()
          Creates a Monitor.
 
Method Summary
 List<ConnectionInfo> getConnections()
           
 ServerInfo getServer()
           
 List<SqlStatementInfo> getSqlStatements()
           
 List<StatementInfo> getStatements()
           
 void sendEvent(Event event)
          Sends an event to the monitor.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMORY_INFO

protected static final Util.MemoryInfo MEMORY_INFO
Constructor Detail

MonitorImpl

public MonitorImpl()
Creates a Monitor.

Method Detail

shutdown

public void shutdown()

sendEvent

public void sendEvent(Event event)
Description copied from interface: Monitor
Sends an event to the monitor.

Specified by:
sendEvent in interface Monitor
Parameters:
event - Event

getServer

public ServerInfo getServer()
Specified by:
getServer in interface Monitor

getConnections

public List<ConnectionInfo> getConnections()
Specified by:
getConnections in interface Monitor

getStatements

public List<StatementInfo> getStatements()
Specified by:
getStatements in interface Monitor

getSqlStatements

public List<SqlStatementInfo> getSqlStatements()
Specified by:
getSqlStatements in interface Monitor

Get Mondrian at SourceForge.net. Fast, secure and free Open Source software downloads