当前位置: 首页>>代码示例>>Java>>正文


Java Cache.newNullCache方法代码示例

本文整理汇总了Java中sun.security.util.Cache.newNullCache方法的典型用法代码示例。如果您正苦于以下问题:Java Cache.newNullCache方法的具体用法?Java Cache.newNullCache怎么用?Java Cache.newNullCache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.security.util.Cache的用法示例。


在下文中一共展示了Cache.newNullCache方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LDAPCertStoreImpl

import sun.security.util.Cache; //导入方法依赖的package包/类
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 */
LDAPCertStoreImpl(String serverName, int port)
    throws InvalidAlgorithmParameterException {
    createInitialDirContext(serverName, port);
    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:LDAPCertStoreImpl.java

示例2: LDAPCertStore

import sun.security.util.Cache; //导入方法依赖的package包/类
/**
 * Creates a <code>CertStore</code> with the specified parameters.
 * For this class, the parameters object must be an instance of
 * <code>LDAPCertStoreParameters</code>.
 *
 * @param params the algorithm parameters
 * @exception InvalidAlgorithmParameterException if params is not an
 *   instance of <code>LDAPCertStoreParameters</code>
 */
public LDAPCertStore(CertStoreParameters params)
        throws InvalidAlgorithmParameterException {
    super(params);
    if (!(params instanceof LDAPCertStoreParameters))
      throw new InvalidAlgorithmParameterException(
        "parameters must be LDAPCertStoreParameters");

    LDAPCertStoreParameters lparams = (LDAPCertStoreParameters) params;

    // Create InitialDirContext needed to communicate with the server
    createInitialDirContext(lparams.getServerName(), lparams.getPort());

    // Create CertificateFactory for use later on
    try {
        cf = CertificateFactory.getInstance("X.509");
    } catch (CertificateException e) {
        throw new InvalidAlgorithmParameterException(
            "unable to create CertificateFactory for X.509");
    }
    if (LIFETIME == 0) {
        valueCache = Cache.newNullCache();
    } else if (LIFETIME < 0) {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE);
    } else {
        valueCache = Cache.newSoftMemoryCache(DEFAULT_CACHE_SIZE, LIFETIME);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:37,代码来源:LDAPCertStore.java


注:本文中的sun.security.util.Cache.newNullCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。