destroyInstance() gracefully shuts down the specified Syslog protocol and
removes the instance from Syslog4j.

@param protocol - the Syslog protocol to destroy
@throws SyslogRuntimeException
355293
public synchronized static void destroyInstance(String protocol) throws SyslogRuntimeException {
        if (StringUtils.isBlank(protocol)) {
            return;
        }

        String _protocol = protocol.toLowerCase();

        if (instances.containsKey(_protocol)) {
            SyslogUtility.sleep(SyslogConstants.THREAD_LOOP_INTERVAL_DEFAULT);

            SyslogIF syslog = instances.get(_protocol);

            try {
                syslog.shutdown();

            } finally {
                instances.remove(_protocol);
            }

        } else {
            throw new SyslogRuntimeException("Cannot destroy protocol \"%s\" instance; call shutdown instead", protocol);
        }
    }
1184800
@Override
    public void destroy() throws ResourceException {
        LOGGER.debug("Shutting down connection to repo '{0}'", mcf.getRepositoryURL());
        this.session.logout();
        this.handles.clear();
    }
138525
public void destroy() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        MUCLightDestroyIQ mucLightDestroyIQ = new MUCLightDestroyIQ(room);
        IQ responseIq = connection.createStanzaCollectorAndSend(mucLightDestroyIQ).nextResultOrThrow();
        boolean roomDestroyed = responseIq.getType().equals(IQ.Type.result);

        if (roomDestroyed) {
            removeConnectionCallbacks();
        }
    }
940756
def destroySingleton(cls):
        
        singleton_key = '_{0}__singleton'.format(cls.__name__)
        singleton = getattr(cls, singleton_key, None)
        
        if singleton is not None:
            setattr(cls, singleton_key, None)

            singleton.close()
            singleton.deleteLater()
1050643
@Override
    public void close() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "close");
        try {
            messageConsumer.close();
        } catch (JMSException jmse) {
            JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.entry(this, tc, "close");
        }

    }
23601
public static final SyslogIF getInstance(String protocol) throws SyslogRuntimeException {
        String _protocol = protocol.toLowerCase();

        if (instances.containsKey(_protocol)) {
            return (SyslogIF) instances.get(_protocol);

        } else {
            StringBuffer message = new StringBuffer("Syslog protocol \"" + protocol + "\" not defined; call Syslogger.createSyslogInstance(protocol,config) first");

            if (instances.size() > 0) {
                message.append(" or use one of the following instances: ");

                Iterator i = instances.keySet().iterator();
                while (i.hasNext()) {
                    String k = (String) i.next();

                    message.append(k);
                    if (i.hasNext()) {
                        message.append(' ');
                    }
                }
            }

            throwRuntimeException(message.toString());
            return null;
        }
    }
931327
function destroyInstance (instanceId) {
  var instance = instances[instanceId] || {};
  if (instance.app instanceof Vue$2) {
    instance.app.$destroy();
  }
  delete instances[instanceId];
}
245469
@Override
    public void destroyXAResource(XAResource xa) throws DestroyXAResourceException {

        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "destroyXAResource", xa);

        ManagedConnection mc = ((WSXAResource) xa).getManagedConnection();
        try {
            mc.destroy();
        } catch (ResourceException x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(tc, "destroyXAResource", x);
            throw new DestroyXAResourceException(x);
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "destroyXAResource");
    }
146477
public static syslog_sslvpn delete(nitro_service client, syslog_sslvpn resource) throws Exception
	{
		resource.validate("delete");
		return ((syslog_sslvpn[]) resource.delete_resource(client))[0];
	}
1024360
public void fireSessionDestroyed(IoSession session) {
        // Try to remove the remaining empty session set after removal.
        if (managedSessions.remove(session.getId()) == null) {
            return;
        }

        // Fire session events.
        session.getFilterChain().fireSessionClosed();

        // Fire listener events.
        try {
            for (IoServiceListener l : listeners) {
                try {
                    l.sessionDestroyed(session);
                } catch (Throwable e) {
                    ExceptionMonitor.getInstance().exceptionCaught(e);
                }
            }
        } finally {
            // Fire a virtual service deactivation event for the last session of the connector.
            if (session.getService() instanceof IoConnector) {
                boolean lastSession;
                synchronized (managedSessions) {
                    lastSession = managedSessions.isEmpty();
                }
                if (lastSession) {
                    fireServiceDeactivated();
                }
            }
        }
    }
914662
public void destroy() {
        JmsUtils.closeSession(session);

        if (connection != null) {
            ConnectionFactoryUtils.releaseConnection(connection, endpointConfiguration.getConnectionFactory(), true);
        }
    }
678717
@SuppressWarnings("rawtypes")
    @Override
    public void destroy() {
        for (List<Handler> handlers : this.handlersMap.values()) {
            for (Handler handler : handlers) {
                try {
                    clientMetaData.getModuleMetaData().getJaxWsInstanceManager().destroyInstance(handler);
                } catch (InterceptException e) {
                    throw new WebServiceException(e);
                }
            }
        }
    }
522853
public void destroy(String name, Object instance)
    {
        if (instance != null && isManagedBean(name))
        {
            try
            {
                _lifecycleProvider.destroyInstance(instance);
            } 
            catch (IllegalAccessException e)
            {
                log.log(Level.SEVERE, "Could not access @PreDestroy method of managed bean " + name, e);
            } 
            catch (InvocationTargetException e)
            {
                log.log(Level.SEVERE, "An Exception occured while invoking " +
                        "@PreDestroy method of managed bean " + name, e);
            }
        }
    }
517674
function destroyComponent(instance) {
            if (util.isFn(instance.destroy) && !instance._destroyed) {
                instance.destroy();
                instance._destroyed = true;
            }
        }
1237547
private final void _destroy(final Method logFactoryRelease) {
		for (final Iterator it = this.childrenMap.entrySet().iterator(); it
				.hasNext();) {
			final Map.Entry entry = (Map.Entry) it.next();
			final CClassLoader loader = (CClassLoader) entry.getValue();
			loader._destroy(logFactoryRelease);
			it.remove();
		}

		try {
			// remove ref from commons logging
			logFactoryRelease.invoke(null, new Object[] { this });
		} catch (final Exception e) {
		}

		try {
			// reset parent to system class loader
			final Field parent = ClassLoader.class.getDeclaredField("parent");
			parent.setAccessible(true);
			parent.set(this, ClassLoader.getSystemClassLoader());
			parent.setAccessible(false);
		} catch (final Throwable ignore) {
		}

		this.classesMap.clear();
		for (final Iterator it = this.dllMap.entrySet().iterator(); it
				.hasNext();) {
			final Object element = it.next();
			final Map.Entry entry = (Map.Entry) element;
			if (entry.getValue() instanceof File) {
				((File) entry.getValue()).delete();
			}
		}
		this.cacheMap.clear();
		this.dllMap.clear();
		this.resourcesMap.clear();
		this.config = null;
		this.name = null;
		this.finalizepath = this.path;
		this.path = null;
		//classes
		System.runFinalization();
		System.gc();
	}
398400
public final void destroy() throws JMException {
        synchronized (mBeanHandles) {
            List<JMException> exceptions = new ArrayList<JMException>();
            List<MBeanHandle> unregistered = new ArrayList<MBeanHandle>();
            for (MBeanHandle handle : mBeanHandles) {
                try {
                    unregistered.add(handle);
                    handle.server.unregisterMBean(handle.objectName);
                } catch (InstanceNotFoundException e) {
                    exceptions.add(e);
                } catch (MBeanRegistrationException e) {
                    exceptions.add(e);
                }
            }
            // Remove all successfully unregistered handles
            mBeanHandles.removeAll(unregistered);

            // Throw error if any exception occured during unregistration
            if (exceptions.size() == 1) {
                throw exceptions.get(0);
            } else if (exceptions.size() > 1) {
                StringBuilder ret = new StringBuilder();
                for (JMException e : exceptions) {
                    ret.append(e.getMessage()).append(", ");
                }
                throw new JMException(ret.substring(0, ret.length() - 2));
            }
        }

        // Unregister any notification listener
        mBeanServerManager.destroy();
    }
100805
@Override
    public void destroy() {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Destroying ISC: " + this);
        }
        // 291714 - clean up the statemap
        getVC().getStateMap().remove(CallbackIDs.CALLBACK_HTTPISC);
        getVC().getStateMap().remove(HTTP_ERROR_IDENTIFIER);
        this.myLink = null;

        super.destroy();
    }