MySnmpCrawler API

snmp.lib
Class ServiceLocator

java.lang.Object
  |
  +--snmp.lib.ServiceLocator

public class ServiceLocator
extends java.lang.Object

This class provides the service to get the objects of major components. The service includes: getSnmpAgent, getMBeanServer, getMibDatabase, and getSnmpMBean that retrieves the SnmpMBean object matching to the OID group name.

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

Field Summary
private  AccessControl accessCtrl
           
private  javax.management.MBeanServer mbeanServer
           
private  MibDatabase mibdb
           
private static ServiceLocator singleton
           
private  SnmpAgent snmpAgent
           
 
Constructor Summary
private ServiceLocator(SnmpAgent agent)
          Constructs the ServiceLocator object with the SnmpAgent..
 
Method Summary
static ServiceLocator getInstance()
          Gets the singleton object of the ServiceLocator.
 javax.management.MBeanServer getMBeanServer()
          Gets the MBeanServer object.
 MibDatabase getMibDatabase()
          Gets the MibDatabase object.
 SnmpAgent getSnmpAgent()
          Gets the SnmpAgent object.
 SnmpMBean getSnmpMBean(java.lang.String oidGroupName)
          Gets the SnmpMBean object matching to the OID group name.
private  void init()
          Invoked to load the objects of major components.
static ServiceLocator loadService(SnmpAgent agent)
          Invoked to load the service with the SnmpAgent object when the system starts.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

singleton

private static ServiceLocator singleton

snmpAgent

private SnmpAgent snmpAgent

mbeanServer

private javax.management.MBeanServer mbeanServer

mibdb

private MibDatabase mibdb

accessCtrl

private AccessControl accessCtrl
Constructor Detail

ServiceLocator

private ServiceLocator(SnmpAgent agent)
                throws SnmpException
Constructs the ServiceLocator object with the SnmpAgent..

Throws:
SnmpException - thrown if any error occurs during the object instantiation.
Method Detail

init

private void init()
           throws SnmpException
Invoked to load the objects of major components.

Throws:
SnmpException - thrown if any error occurs during objects initialization.

getSnmpAgent

public SnmpAgent getSnmpAgent()
Gets the SnmpAgent object.


getMBeanServer

public javax.management.MBeanServer getMBeanServer()
Gets the MBeanServer object.


getMibDatabase

public MibDatabase getMibDatabase()
Gets the MibDatabase object.


getSnmpMBean

public SnmpMBean getSnmpMBean(java.lang.String oidGroupName)
                       throws SnmpException
Gets the SnmpMBean object matching to the OID group name.

Parameters:
oidGroupName - The OID group name.
Returns:
snmpMBean The matched SnmpMBean object.
SnmpException

loadService

public static ServiceLocator loadService(SnmpAgent agent)
                                  throws SnmpException
Invoked to load the service with the SnmpAgent object when the system starts.

Returns:
Singleton object of the ServiceLocator.
Throws:
SnmpException - thrown if any error occurs during the object instantiation.

getInstance

public static ServiceLocator getInstance()
                                  throws SnmpException
Gets the singleton object of the ServiceLocator.

Returns:
Singleton object of the ServiceLocator.
Throws:
SnmpException - thrown if any error occurs during the object instantiation.

MySnmpCrawler API