Removes previously installed SLF4JBridgeHandler instances. See also
{@link #install()}.

@throws SecurityException A <code>SecurityException</code> is thrown, if a security manager
exists and if the caller does not have
LoggingPermission("control").
343769
public static void uninstall() throws SecurityException {
        java.util.logging.Logger rootLogger = getRootLogger();
        Handler[] handlers = rootLogger.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            if (handlers[i] instanceof SLF4JBridgeHandler) {
                rootLogger.removeHandler(handlers[i]);
            }
        }
    }
168772
public static void removeHandlersForRootLogger() {
        java.util.logging.Logger rootLogger = getRootLogger();
        java.util.logging.Handler[] handlers = rootLogger.getHandlers();
        for (int i = 0; i < handlers.length; i++) {
            rootLogger.removeHandler(handlers[i]);
        }
    }
1326412
def remove_loghandler (handler):
    """"""
    logging.getLogger(LOG_ROOT).removeHandler(handler)
    logging.getLogger().removeHandler(handler)
1298351
public synchronized void close() throws SecurityException {
        super.close();
        // Unlock any lock file.
        if (lockFileName == null) {
            return;
        }
        try {
            // Closing the lock file's FileOutputStream will close
            // the underlying channel and free any locks.
            lockStream.close();
        } catch (Exception ex) {
            // Problems closing the stream.  Punt.
        }
        synchronized(locks) {
            locks.remove(lockFileName);
        }
        new File(lockFileName).delete();
        lockFileName = null;
        lockStream = null;
    }
822792
private void disableCertificateVerification()
            throws KeyManagementException, NoSuchAlgorithmException {
        // Create a trust manager that does not validate certificate chains
        final TrustManager[] trustAllCerts = new TrustManager[] { new CustomTrustManager() };

        // Install the all-trusting trust manager
        final SSLContext sslContext = SSLContext.getInstance("SSL");
        sslContext.init(null, trustAllCerts, new SecureRandom());
        final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();
        HttpsURLConnection.setDefaultSSLSocketFactory(sslSocketFactory);
        final HostnameVerifier verifier = new HostnameVerifier() {
            @Override
            public boolean verify(final String hostname,
                    final SSLSession session) {
                return true;
            }
        };

        HttpsURLConnection.setDefaultHostnameVerifier(verifier);
    }
396756
public void updateClientManagement(Boolean clientManagement) throws SecurityException {
	checkWriteAccess();
	boolean hasAccess = ConfigWebUtil.hasAccess(config, SecurityManager.TYPE_SETTING);

	if (!hasAccess) throw new SecurityException("no access to update scope setting");

	Element scope = _getRootElement("scope");
	scope.setAttribute("clientmanagement", Caster.toString(clientManagement, ""));
    }
140543
@CallerSensitive
    public static synchronized void deregisterDriver(Driver driver)
        throws SQLException {
        if (driver == null) {
            return;
        }

        println("DriverManager.deregisterDriver: " + driver);

        DriverInfo aDriver = new DriverInfo(driver);
        if(registeredDrivers.contains(aDriver)) {
            if (isDriverAllowed(driver, ClassLoader.getSystemClassLoader())) {
                 registeredDrivers.remove(aDriver);
            } else {
                // If the caller does not have permission to load the driver then
                // throw a SecurityException.
                throw new SecurityException();
            }
        } else {
            println("    couldn't find driver to unload");
        }
    }
642450
private void processSecurityRoles(List<SecurityRole> securityRoles) {
        for (SecurityRole securityRole : securityRoles) {
            if (!allRoles.contains(securityRole.getRoleName())) {
                allRoles.add(securityRole.getRoleName());
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "allRoles: " + allRoles);
        }
    }
266089
protected synchronized void unsetHandler(ServiceReference<Handler> handlerRef) {

        jaxwsInFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxwsOutFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxwsInFlowServerSideGlobalHandlers.removeReference(handlerRef);
        jaxwsOutFlowServerSideGlobalHandlers.removeReference(handlerRef);

        jaxrsInFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxrsOutFlowClientSideGlobalHandlers.removeReference(handlerRef);
        jaxrsInFlowServerSideGlobalHandlers.removeReference(handlerRef);
        jaxrsOutFlowServerSideGlobalHandlers.removeReference(handlerRef);

        String importPackage = handlerRef.getBundle().getHeaders("").get("Import-package");
        String dynamicImportPackage = handlerRef.getBundle().getHeaders("").get("DynamicImport-Package");

        if ((importPackage != null && importPackage.contains("javax.xml.ws.handler.soap")) ||
            (dynamicImportPackage != null && dynamicImportPackage.contains("javax.xml.ws.handler.soap")))
        {
            saajCount.getAndDecrement();
        }

        clearAllList();

        //jaxws
        Iterator<Handler> registeredHandlers = jaxwsInFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsInFlowServerSideGlobalHandlers1.add(registeredHandlers.next());
        }

        registeredHandlers = jaxwsOutFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsOutFlowServerSideGlobalHandlers1.add(0, registeredHandlers.next());
        }

        registeredHandlers = jaxwsInFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsInFlowClientSideGlobalHandlers1.add(registeredHandlers.next());
        }

        registeredHandlers = jaxwsOutFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxwsOutFlowClientSideGlobalHandlers1.add(0, registeredHandlers.next());
        }
        //jaxrs
        registeredHandlers = jaxrsOutFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsOutFlowServerSideGlobalHandlers1.add(0, registeredHandlers.next());
        }

        registeredHandlers = jaxrsInFlowServerSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsInFlowServerSideGlobalHandlers1.add(registeredHandlers.next());
        }

        registeredHandlers = jaxrsOutFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsOutFlowClientSideGlobalHandlers1.add(0, registeredHandlers.next());
        }

        registeredHandlers = jaxrsInFlowClientSideGlobalHandlers.getServices();
        while (registeredHandlers.hasNext()) {
            jaxrsInFlowClientSideGlobalHandlers1.add(registeredHandlers.next());
        }

    }
1117963
protected void bindWebSecurityManager(AnnotatedBindingBuilder<? super WebSecurityManager> bind) {
        try {
            bind.toConstructor(DefaultWebSecurityManager.class.getConstructor(Collection.class)).asEagerSingleton();
        } catch (NoSuchMethodException e) {
            throw new ConfigurationException("This really shouldn't happen.  Either something has changed in Shiro, or there's a bug in ShiroModule.", e);
        }
    }
729519
private void tearDownShiro()
  {
    try
    {
      SecurityManager securityManager = SecurityUtils.getSecurityManager();

      LifecycleUtils.destroy(securityManager);
      ThreadContext.unbindSecurityManager();
      ThreadContext.unbindSubject();
      ThreadContext.remove();
    }
    catch (UnavailableSecurityManagerException e)
    {

      // we don't care about this when cleaning up the test environment
      // (for example, maybe the subclass is a unit test and it didn't
      // need a SecurityManager instance because it was using only mock Subject instances)
    }

    SecurityUtils.setSecurityManager(null);
  }
1362018
public void removeDynamicServlet(String servletName) throws SecurityException {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && logger.isLoggable(Level.FINE)) {
            logger.logp(Level.FINE, CLASS_NAME, "removeDynamicServlet", "remove dynamic servlet for -->" + servletName);
        }
        SecurityManager sm = System.getSecurityManager();
        if (sm != null) {
            sm.checkPermission(perm);
        }
        removeServlet(servletName);
    }
773682
public void removeNotificationHandler(String serviceName, NotificationHandler handler) {

        ServiceInstanceUtils.validateServiceName(serviceName);
        if (handler == null) {
            throw new ServiceException(ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR,
                    ErrorCode.SERVICE_DIRECTORY_NULL_ARGUMENT_ERROR.getMessageTemplate(),
                    "NotificationHandler");
        }
        List<InstanceChangeListener<ModelServiceInstance>> list = changeListenerMap.get(serviceName);
        if (list != null) {
            boolean found = false;
            for (InstanceChangeListener<ModelServiceInstance> listener : list) {
                if (listener instanceof NotificationHandlerAdapter
                        && ((NotificationHandlerAdapter) listener).getAdapter() == handler) {
                    list.remove(listener);
                    found = true;
                    break;
                }
            }
            if (!found) {
               LOGGER.error(ErrorCode.NOTIFICATION_HANDLER_DOES_NOT_EXIST.getMessageTemplate());
            }
        } else {
            LOGGER.error(String.format(ErrorCode.SERVICE_DOES_NOT_EXIST.getMessageTemplate(), serviceName));
        }

    }
1242199
protected final void destroyHandleList() // d662032
    {
        if (connectionHandleList != null)
        {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "destroyHandleList: destroying " + connectionHandleList);
            connectionHandleList.componentDestroyed();
            connectionHandleList = null;
        }
    }
1231723
def securityHandler(self, value):
        
        if isinstance(value, BaseSecurityHandler):
            if isinstance(value, security.AGSTokenSecurityHandler):
                self._securityHandler = value
            else:
                pass
        elif value is None:
            self._securityHandler = None
588806
private static void disableSSLCertificateChecking() {
        TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }

            @Override
            public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
                // Not implemented
            }

            @Override
            public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
                // Not implemented
            }
        } };

        try {
            SSLContext sc = SSLContext.getInstance("TLS");
            sc.init(null, trustAllCerts, new java.security.SecureRandom());

            HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

            // Create all-trusting host name verifier
            HostnameVerifier allHostsValid = new HostnameVerifier() {
                public boolean verify(String hostname, SSLSession session) {
                    return true;
                }
            };

            // Install the all-trusting host verifier
            HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
        } catch (KeyManagementException e) {
            throw new IllegalArgumentException("Disabling SSL certificate failed: " + e,e);
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalArgumentException("Disabling SSL certificate failed: " + e,e);
        }
    }
652171
@SuppressFBWarnings(value = "SIC", justification = "Should not be used in production anyways.")
  public void ignoreCertCheck() throws NoSuchAlgorithmException, KeyManagementException {
    final TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
        @Override
        public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
          return new X509Certificate[]{};
        }
      }
    };

    final SSLContext sslContext = SSLContext.getInstance("SSL");
    sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
    final SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory();

    this.httpClient = this.httpClient.newBuilder()
      .sslSocketFactory(sslSocketFactory, (X509TrustManager)trustAllCerts[0])
      .hostnameVerifier(new HostnameVerifier() {
          @Override
          public boolean verify(String hostname, SSLSession session) {
            return true;
          }
        })
      .build();
  }