Deregisters MBeans/MXBeans.
164198
public static void unpopulateMBeanServer() {
		if(!populated)
			return;
		
		synchronized (lock) {
			populated = false;
			
			if (storageManager != null && storageManager.getPublicName() != null) {
				logger.info("Unregistering the StorageManager MXBean");
				try { 
					storageManager.deregister(); 
					storageManager.awaitJobTermination(2 * 60);
				} catch(Exception ex) {
					logger.warn("Can't unregister StorageManager MXBean.", ex);
				}
			}
			if (serverMonitor != null && serverMonitor.getPublicName() != null) {
				logger.info("Unregistering the ServerMonitor MXBean");
				try { 
					serverMonitor.deregister(); 
					serverMonitor.shutdown();
				} catch(Exception ex) {
					logger.warn("Can't unregister ServerMonitor MXBean.", ex);
				}
			}
			
			storageManager = null;
			serverMonitor = null;
		}
	}
1368418
public function down()
    {
        Schema::drop($this->prefixCmsTable('activations'));
        Schema::drop($this->prefixCmsTable('persistences'));
        Schema::drop($this->prefixCmsTable('reminders'));
        Schema::drop($this->prefixCmsTable('role_users'));
        Schema::drop($this->prefixCmsTable('throttle'));
        Schema::drop($this->prefixCmsTable('roles'));
        Schema::drop($this->prefixCmsTable('users'));
    }
982832
public function down()
    {
        Schema::drop('watched_items');
        Schema::drop('failed_jobs');
        Schema::drop('delivery_options');
        Schema::drop('item_categories');
        Schema::drop('items');
        Schema::drop('item_conditions');
        Schema::drop('listing_durations');
        Schema::drop('categories');

        Schema::table('users', function (Blueprint $table) {
            $table->string('username', 255)->change();
            $table->string('email', 255)->change();
            $table->string('password', 60)->change();
            $table->dropColumn('locale');
            $table->dropColumn('currency');
            $table->dropColumn('joined');
            $table->dropColumn('last_login');
            $table->dropColumn('notifications');
            $table->timestamps();

            $table->renameColumn('user_id', 'id');
            $table->renameColumn('username', 'name');
        });
    }
19069
public function deleteAllGeneratorTables()
    {
        $tables = [];

        /**
         * @var ClassMetadata $class
         */
        foreach ($this->metadataFactory->getAllMetadata() as $class) {
            $tables = array_merge(
                $tables,
                $this->getGeneratorTablesFor($class)
            );
        }

        foreach ($tables as $tableName => $definition) {
            $this->doDeleteTable($tableName, $definition);
        }
    }
1123442
@Override
    public void destroy() {
        shell.unregisterPlugin(this);
        executeAction(PluginAction.UNLOAD, false);
        CommandUtil.dissociateAll(container);

        if (pluginEventListeners1 != null) {
            pluginEventListeners1.clear();
            pluginEventListeners1 = null;
        }

        if (pluginEventListeners2 != null) {
            executeAction(PluginAction.UNSUBSCRIBE, false);
            pluginEventListeners2.clear();
            pluginEventListeners2 = null;
        }

        if (registeredProperties != null) {
            registeredProperties.clear();
            registeredProperties = null;
        }

        if (registeredBeans != null) {
            registeredBeans.clear();
            registeredBeans = null;
        }

        if (registeredComponents != null) {
            for (BaseComponent component : registeredComponents) {
                component.destroy();
            }

            registeredComponents.clear();
            registeredComponents = null;
        }

        super.destroy();
    }
858536
public void closeMBeans() {
    try {
      for (final ObjectName name : registeredMBeans) {
        getMbeanServer().unregisterMBean(name);
        logger.info("Jmx MBean " + name.getCanonicalName() + " unregistered.");
      }
    } catch (final Exception e) {
      logger.error("Failed to cleanup MBeanServer", e);
    }
  }
148067
public static void registerMXBean(Cache<?, ?> cache, Object mxbean, MBeanType type) {
    ObjectName objectName = getObjectName(cache, type);
    register(objectName, mxbean);
  }
34787
public void deregisterDestination()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "deregisterDestination");

    _trmFacade.deregisterDestination();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "deregisterDestination");
  }
775489
public static boolean deregister( @Nonnull final Factory factory )
  {
    if ( g_factory != factory )
    {
      return false;
    }
    else
    {
      g_factory = null;
      return true;
    }
  }
151685
public void close() {
        synchronized(factory.cnxns){
            // if this is not in cnxns then it's already closed
            if (!factory.cnxns.remove(this)) {
                return;
            }

            synchronized (factory.ipMap) {
                Set<NIOServerCnxn> s =
                    factory.ipMap.get(sock.socket().getInetAddress());
                s.remove(this);
            }

            // unregister from JMX
            try {
                if(jmxConnectionBean != null){
                    MBeanRegistry.getInstance().unregister(jmxConnectionBean);
                }
            } catch (Exception e) {
                LOG.warn("Failed to unregister with JMX", e);
            }
            jmxConnectionBean = null;

            if (zk != null) {
                zk.removeCnxn(this);
            }

            closeSock();

            if (sk != null) {
                try {
                    // need to cancel this selection key from the selector
                    sk.cancel();
                } catch (Exception e) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("ignoring exception during selectionkey cancel", e);
                    }
                }
            }
        }
    }
126443
@Override
	public void rebuildDirtyBundles() {
		if (jsMBean != null) {
			jsMBean.rebuildDirtyBundles();
		}
		if (cssMBean != null) {
			cssMBean.rebuildDirtyBundles();
		}
		if (binaryMBean != null) {
			binaryMBean.rebuildDirtyBundles();
		}
	}
60881
public function migrateDown()
    {
        Schema::table('tddd_testers', function (Blueprint $table) {
            $table->boolean('require_tee');

            $table->boolean('require_script');

            $table->dropColumn('pipers');
        });
    }
125103
public boolean unregisterMBean(String name) throws MBeanRegistrationException {

        synchronized (mBeanServer) {

            ObjectName toRemoveName;

            try {
                toRemoveName = new ObjectName(name);
            } catch (MalformedObjectNameException e) {
                return false; // bean with malformed can not be registered.
            }

            beansNames.remove(toRemoveName);

            try {
                mBeanServer.unregisterMBean(toRemoveName);
                return true;
            } catch (InstanceNotFoundException e) {
                return false;
            }

        }

    }
706948
@Invalidate
    public void tearDown() {
        if (registration != null) {
            registration.unregister();
            registration = null;
        }
        if (factoryRegistration != null) {
            factoryRegistration.unregister();
            factoryRegistration = null;
        }
    }
392079
private static void unregisterMBean(String name) {
        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
        try {
            synchronized (mbs) {
                ObjectName objName = new ObjectName(name);
                if (mbs.isRegistered(objName)) {
                    mbs.unregisterMBean(objName);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
922326
public function down()
    {
    	Schema::drop('SL_Databases');
		Schema::drop('SL_Tables');
		Schema::drop('SL_Fields');
		Schema::drop('SL_Definitions');
		Schema::drop('SL_BusRules');
		Schema::drop('SL_Tree');
		Schema::drop('SL_Node');
		Schema::drop('SL_NodeResponses');
		Schema::drop('SL_Conditions');
		Schema::drop('SL_ConditionsVals');
		Schema::drop('SL_ConditionsNodes');
		Schema::drop('SL_ConditionsArticles');
		Schema::drop('SL_DataLoop');
		Schema::drop('SL_DataSubsets');
		Schema::drop('SL_DataHelpers');
		Schema::drop('SL_DataLinks');
		Schema::drop('SL_Images');
		Schema::drop('SL_SearchRecDump');
		Schema::drop('SL_DesignTweaks');
		Schema::drop('SL_Sess');
		Schema::drop('SL_SessLoops');
		Schema::drop('SL_NodeSavesPage');
		Schema::drop('SL_NodeSaves');
		Schema::drop('SL_SessEmojis');
		Schema::drop('SL_SessSite');
		Schema::drop('SL_SessPage');
		Schema::drop('SL_Tokens');
		Schema::drop('SL_UsersRoles');
		Schema::drop('SL_Contact');
		Schema::drop('SL_Emails');
		Schema::drop('SL_Emailed');
		Schema::drop('SL_UsersActivity');
		Schema::drop('SL_LogActions');
		Schema::drop('SL_Zips');
		Schema::drop('SL_AddyGeo');
		Schema::drop('SL_Uploads');
	
    }
699226
public static void unregisterMbean(MBeanServer server, ObjectName name) {
        try {
            server.unregisterMBean(name);
        } catch(Exception e) {
            logger.error("Error unregistering mbean", e);
        }
    }