cz.cuni.amis.pogamut.base.utils.logging.jmx
Class AgentLoggerJMXProxy

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.utils.logging.AbstractAgentLogger
      extended by cz.cuni.amis.pogamut.base.utils.logging.jmx.AgentLoggerJMXProxy
All Implemented Interfaces:
IJMXEnabled, IAgentLogger, IJMXAgentLogger

public class AgentLoggerJMXProxy
extends AbstractAgentLogger

Makes remote AgentLogger look like local logger. The communication is handled through JMX interface.

IJMXAgentLogger interface is fully proxied (executes JMX remote calls).


Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.base.utils.logging.AbstractAgentLogger
agentId, LOG_CATEGORY_NAME
 
Constructor Summary
AgentLoggerJMXProxy(IAgentId agentName, javax.management.MBeanServerConnection mbsc, javax.management.ObjectName parentName)
           
 
Method Summary
 void addDefaultNetworkHandler()
          Executes JMX remote call to the proxied IAgentLogger.addDefaultNetworkHandler() method.
 void enableJMX(javax.management.MBeanServer mBeanServer, javax.management.ObjectName parent)
          Method for starting the JMX extension of the class.
protected  ILogCategories getLogCategories()
           
 java.lang.String getNetworkLoggerHost()
          Executes JMX remote call to the proxied IAgentLogger.getNetworkLoggerHost() method.
 java.lang.Integer getNetworkLoggerPort()
          Executes JMX remote call to the proxied IAgentLogger.getNetworkLoggerPort() method.
 boolean isDefaultNetworkHandler()
          Executes JMX remote call to the proxied IAgentLogger.isDefaultNetworkHandler() method.
 void removeDefaultNetworkHandler()
          Executes JMX remote call to the proxied IAgentLogger.removeDefaultNetworkHandler() method.
 
Methods inherited from class cz.cuni.amis.pogamut.base.utils.logging.AbstractAgentLogger
addDefaultConsoleHandler, addDefaultFileHandler, addDefaultHandler, addDefaultPublisher, addToAllCategories, addToAllCategories, getAgentId, getCategories, getCategory, getCategory, getDefaultConsoleHandler, getDefaultNetworkHandler, isDefaultConsoleHandler, removeDefaultConsoleHandler, removeDefaultHandler, removeFromAllCategories, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgentLoggerJMXProxy

public AgentLoggerJMXProxy(IAgentId agentName,
                           javax.management.MBeanServerConnection mbsc,
                           javax.management.ObjectName parentName)
Method Detail

getLogCategories

protected ILogCategories getLogCategories()
Specified by:
getLogCategories in class AbstractAgentLogger

enableJMX

public void enableJMX(javax.management.MBeanServer mBeanServer,
                      javax.management.ObjectName parent)
               throws JMXAlreadyEnabledException,
                      CantStartJMXException
Description copied from interface: IJMXEnabled
Method for starting the JMX extension of the class.

Object should register whatever objects it wants to expose via JMX.

Parameters:
mBeanServer - server where the MBean of agent is registered
parent - parent's ObjectName, should be used as base of name of the registered MBean
Throws:
JMXAlreadyEnabledException
CantStartJMXException

getNetworkLoggerHost

public java.lang.String getNetworkLoggerHost()
Executes JMX remote call to the proxied IAgentLogger.getNetworkLoggerHost() method.

Specified by:
getNetworkLoggerHost in interface IAgentLogger
Specified by:
getNetworkLoggerHost in interface IJMXAgentLogger
Overrides:
getNetworkLoggerHost in class AbstractAgentLogger
Returns:
See Also:
IAgentLogger.getNetworkLoggerHost()

getNetworkLoggerPort

public java.lang.Integer getNetworkLoggerPort()
Executes JMX remote call to the proxied IAgentLogger.getNetworkLoggerPort() method.

Specified by:
getNetworkLoggerPort in interface IAgentLogger
Specified by:
getNetworkLoggerPort in interface IJMXAgentLogger
Overrides:
getNetworkLoggerPort in class AbstractAgentLogger
Returns:
See Also:
IAgentLogger.getNetworkLoggerPort()

addDefaultNetworkHandler

public void addDefaultNetworkHandler()
Executes JMX remote call to the proxied IAgentLogger.addDefaultNetworkHandler() method.

Specified by:
addDefaultNetworkHandler in interface IAgentLogger
Specified by:
addDefaultNetworkHandler in interface IJMXAgentLogger
Overrides:
addDefaultNetworkHandler in class AbstractAgentLogger
See Also:
IAgentLogger.addDefaultNetworkHandler()

removeDefaultNetworkHandler

public void removeDefaultNetworkHandler()
Executes JMX remote call to the proxied IAgentLogger.removeDefaultNetworkHandler() method.

Specified by:
removeDefaultNetworkHandler in interface IAgentLogger
Specified by:
removeDefaultNetworkHandler in interface IJMXAgentLogger
Overrides:
removeDefaultNetworkHandler in class AbstractAgentLogger
See Also:
IAgentLogger.removeDefaultNetworkHandler()

isDefaultNetworkHandler

public boolean isDefaultNetworkHandler()
Executes JMX remote call to the proxied IAgentLogger.isDefaultNetworkHandler() method.

Specified by:
isDefaultNetworkHandler in interface IAgentLogger
Specified by:
isDefaultNetworkHandler in interface IJMXAgentLogger
Overrides:
isDefaultNetworkHandler in class AbstractAgentLogger
Returns:
See Also:
IAgentLogger.isDefaultNetworkHandler()