MySnmpCrawler API

snmp.agent
Class BaseAgent

java.lang.Object
  |
  +--snmp.agent.BaseAgent
Direct Known Subclasses:
SnmpAgent

public abstract class BaseAgent
extends java.lang.Object

This abstract class encapsulates necessary routines to start and maintain the JMX MBean server.

Version:
$Revision: 0.1 $ $Date: 2004/03/09 06:03:56 $
Author:
Scott Cheng

Field Summary
private  com.sun.jdmk.comm.HtmlAdaptorServer html
           
private  javax.management.MBeanServer server
           
 
Constructor Summary
BaseAgent()
          Constructs the BaseAgent object and creates the JMX MBean server.
 
Method Summary
 void addHtmlAdaptor()
          Creates, registers and starts the HTML adaptor.
 void addMBean(java.lang.Object mbean, javax.management.ObjectName mbean_name)
          Registers the MBean with the given name to the MBean server.
 void addMBean(java.lang.Object mbean, java.lang.String name)
          Registers the MBean with the given name to the MBean server.
 javax.management.MBeanServer getMBeanServer()
          Gets the object of the MBean server.
protected  void startHtmlAdaptor()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

server

private javax.management.MBeanServer server

html

private com.sun.jdmk.comm.HtmlAdaptorServer html
Constructor Detail

BaseAgent

public BaseAgent()
          throws javax.management.MalformedObjectNameException,
                 javax.management.InstanceAlreadyExistsException,
                 javax.management.MBeanRegistrationException,
                 javax.management.NotCompliantMBeanException,
                 SnmpException
Constructs the BaseAgent object and creates the JMX MBean server.

Throws:
javax.management.MalformedObjectNameException - Thrown if the name of the MBean not acceptable by the MBean server.
javax.management.InstanceAlreadyExistsException - Thrown if the MBean already existed in the MBean server.
javax.management.MBeanRegistrationException - Thrown if an error occurs during the MBean registration.
javax.management.NotCompliantMBeanException - Thrown if the MBean is not valid.
SnmpException
Method Detail

addHtmlAdaptor

public void addHtmlAdaptor()
                    throws javax.management.MalformedObjectNameException,
                           javax.management.InstanceAlreadyExistsException,
                           javax.management.MBeanRegistrationException,
                           javax.management.NotCompliantMBeanException,
                           SnmpException
Creates, registers and starts the HTML adaptor.

Throws:
javax.management.MalformedObjectNameException - Thrown if the name of the MBean not acceptable by the MBean server.
javax.management.InstanceAlreadyExistsException - Thrown if the MBean already existed in the MBean server.
javax.management.MBeanRegistrationException - Thrown if an error occurs during the MBean registration.
javax.management.NotCompliantMBeanException - Thrown if the MBean is not valid.
SnmpException

startHtmlAdaptor

protected void startHtmlAdaptor()

addMBean

public void addMBean(java.lang.Object mbean,
                     java.lang.String name)
              throws javax.management.MalformedObjectNameException,
                     javax.management.InstanceAlreadyExistsException,
                     javax.management.MBeanRegistrationException,
                     javax.management.NotCompliantMBeanException,
                     SnmpException
Registers the MBean with the given name to the MBean server.

Throws:
javax.management.MalformedObjectNameException - Thrown if the name of the MBean not acceptable by the MBean server.
javax.management.InstanceAlreadyExistsException - Thrown if the MBean already existed in the MBean server.
javax.management.MBeanRegistrationException - Thrown if an error occurs during the MBean registration.
javax.management.NotCompliantMBeanException - Thrown if the MBean is not valid.
SnmpException

addMBean

public void addMBean(java.lang.Object mbean,
                     javax.management.ObjectName mbean_name)
              throws javax.management.InstanceAlreadyExistsException,
                     javax.management.MBeanRegistrationException,
                     javax.management.NotCompliantMBeanException,
                     SnmpException
Registers the MBean with the given name to the MBean server.

Throws:
javax.management.InstanceAlreadyExistsException - Thrown if the MBean already existed in the MBean server.
javax.management.MBeanRegistrationException - Thrown if an error occurs during the MBean registration.
javax.management.NotCompliantMBeanException - Thrown if the MBean is not valid.
SnmpException

getMBeanServer

public javax.management.MBeanServer getMBeanServer()
Gets the object of the MBean server.

Returns:
the server

MySnmpCrawler API