mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

fguigues
30.04.2008 c41b122d3771d11cb253eaae10d06afb6a3b6f05
opends/src/snmp/src/org/opends/server/snmp/SNMPClassLoaderProvider.java
@@ -116,6 +116,8 @@
    private SnmpV3AdaptorServer snmpAdaptor;
    private String contextName;
    /**
     * Default constructor.
     */
@@ -222,6 +224,7 @@
        this.snmpPort = this.currentConfig.getListenPort();
        this.snmpTrapPort = this.currentConfig.getTrapPort();
        this.registeredSNMPMBeans = this.currentConfig.isRegisteredMbean();
        this.contextName = this.currentConfig.getCommunity();
        // Creates all the required objects for SNMP MIB 2605 Support
        try {
@@ -262,7 +265,9 @@
            this.dsMib = new DIRECTORY_SERVER_MIBImpl(
                    this.registeredSNMPMBeans, this.mibObjName);
            this.dsMib.preRegister(this.server, this.mibObjName);
            this.dsMib.setSnmpAdaptor(snmpAdaptor);
            // Register the DS MIB into the defined context
            this.dsMib.setSnmpAdaptor(snmpAdaptor, this.contextName);
            this.server.registerMBean(this.snmpAdaptor, snmpObjName);
@@ -290,7 +295,12 @@
            this.snmpAdaptor.stop();
            this.server.unregisterMBean(this.snmpObjName);
            this.server.unregisterMBean(this.mibObjName );
            if (this.server.isRegistered(this.mibObjName)) {
               this.server.unregisterMBean(this.mibObjName);
            }
            this.server.unregisterMBean(new ObjectName(
                        SNMPConnectionHandlerDefinitions.SNMP_DOMAIN +
                        "type=group,name=DsMib"));