javax.security.auth.message.config.AuthConfigFactory.detachListener()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(106)

本文整理了Java中javax.security.auth.message.config.AuthConfigFactory.detachListener()方法的一些代码示例,展示了AuthConfigFactory.detachListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AuthConfigFactory.detachListener()方法的具体详情如下:
包路径:javax.security.auth.message.config.AuthConfigFactory
类名称:AuthConfigFactory
方法名:detachListener

AuthConfigFactory.detachListener介绍

[英]Disassociate the listener from all the provider registrations whose layer and appContext values are matched by the corresponding arguments to this method.

Factories should periodically notify Listeners to effectively detach listeners that are no longer in use.

When a SecurityManager is enabled, and before making any changes to the factory, this method must confirm that the calling access control context has been granted the providerRegistrationSecurityPermission.
[中]解除侦听器与所有提供程序注册的关联,这些提供程序注册的层和appContext值与此方法的相应参数匹配。
工厂应该定期通知侦听器,以便有效地分离不再使用的侦听器。
启用SecurityManager时,在对工厂进行任何更改之前,此方法必须确认调用的访问控制上下文已被授予providerRegistrationSecurityPermission。

代码示例

代码示例来源:origin: wildfly/wildfly

@Override
public String[] detachListener(RegistrationListener listener, String layer, String appContext) {
  String[] elytronRegistrationIds = elytronAuthConfigFactory.detachListener(listener, layer, appContext);
  String[] backupRegistrationIds = backupAuthConfigFactory.detachListener(listener, layer, appContext);
  return combine(elytronRegistrationIds, backupRegistrationIds);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

@Override
public String[] detachListener(RegistrationListener listener, String layer, String appContext) {
  String[] elytronRegistrationIds = elytronAuthConfigFactory.detachListener(listener, layer, appContext);
  String[] backupRegistrationIds = backupAuthConfigFactory.detachListener(listener, layer, appContext);
  return combine(elytronRegistrationIds, backupRegistrationIds);
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-jaspi

@Override
public String[] detachListener(RegistrationListener listener, String layer, String appContext) {
  String[] elytronRegistrationIds = elytronAuthConfigFactory.detachListener(listener, layer, appContext);
  String[] backupRegistrationIds = backupAuthConfigFactory.detachListener(listener, layer, appContext);
  return combine(elytronRegistrationIds, backupRegistrationIds);
}

代码示例来源:origin: org.glassfish.main.security/security-ee

public void disable() {
      this.wLock.lock();
      try {
        setEnabled(false);
      } finally {
        this.wLock.unlock();
        data = null;
      }
      if (factory != null) {
        String[] ids = factory.detachListener(this.listener,layer,appCtxt);
//                if (ids != null) {
//                    for (int i=0; i < ids.length; i++) {
//                        factory.removeRegistration(ids[i]);
//                    }
//                }
        if (getJmacProviderRegisID() != null) {
          factory.removeRegistration(getJmacProviderRegisID());
        }
      }
    }

代码示例来源:origin: org.glassfish.security/security

public void disable() {
      this.wLock.lock();
      try {
        setEnabled(false);
      } finally {
        data = null;
        this.wLock.unlock();
      }
      if (factory != null) {
        String[] ids = factory.detachListener(this.listener,layer,appCtxt);
//                if (ids != null) {
//                    for (int i=0; i < ids.length; i++) {
//                        factory.removeRegistration(ids[i]);
//                    }
//                }
        if (getJmacProviderRegisID() != null) {
          factory.removeRegistration(getJmacProviderRegisID());
        }
      }
    }

相关文章