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


Java GenericKeyedObjectPoolConfig.setBlockWhenExhausted方法代码示例

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


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

示例1: getColorSpacePoolConfig

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
public GenericKeyedObjectPoolConfig getColorSpacePoolConfig() {
	GenericKeyedObjectPoolConfig result = new GenericKeyedObjectPoolConfig();
	if (colorSpacePoolMaxTotal != null) {
		result.setMaxTotal(colorSpacePoolMaxTotal);
	}
	if (colorSpacePoolMaxPerKey != null) {
		result.setMaxTotalPerKey(colorSpacePoolMaxPerKey);
	}
	if (colorSpacePoolMaxIdlePerKey != null) {
		result.setMaxIdlePerKey(colorSpacePoolMaxIdlePerKey);
	}
	if (colorSpacePoolMinIdlePerKey != null) {
		result.setMinIdlePerKey(colorSpacePoolMinIdlePerKey);
	}
	if (colorSpacePoolMaxWait != null) {
		result.setMaxWaitMillis(colorSpacePoolMaxWait);
	}
	if (colorSpacePoolMinEvictableIdleTime != null) {
		result.setMinEvictableIdleTimeMillis(colorSpacePoolMinEvictableIdleTime);
	}
	if (colorSpacePoolSoftMinEvictableIdleTime != null) {
		result.setSoftMinEvictableIdleTimeMillis(colorSpacePoolSoftMinEvictableIdleTime);
	}
	if (colorSpacePoolTimeBetweenEvictionRuns != null) {
		result.setTimeBetweenEvictionRunsMillis(colorSpacePoolTimeBetweenEvictionRuns);
	}
	if (colorSpacePoolBlockWhenExhausted != null) {
		result.setBlockWhenExhausted(colorSpacePoolBlockWhenExhausted);
	}
	return result;
}
 
开发者ID:marrow16,项目名称:ColorConverter,代码行数:32,代码来源:Configuration.java

示例2: getChannelPool

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
@Bean
public GenericKeyedObjectPool<ChannelSessionKey, Channel> getChannelPool(final SshConfig sshConfig) throws JSchException {
    final GenericKeyedObjectPoolConfig genericKeyedObjectPoolConfig = new GenericKeyedObjectPoolConfig();
    genericKeyedObjectPoolConfig.setMaxTotalPerKey(10);
    genericKeyedObjectPoolConfig.setBlockWhenExhausted(true);
    return new GenericKeyedObjectPool(new KeyedPooledJschChannelFactory(sshConfig.getJschBuilder().build()));
}
 
开发者ID:cerner,项目名称:jwala,代码行数:8,代码来源:AemServiceConfiguration.java

示例3: startPool

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
/**
 * Apply Pool Configurations read from config/connection.properties Start Keyed pool for IpmiTaskConnectorFactory
 */
public void startPool()
{
    GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
    config.setMaxTotalPerKey( maxObjectPerKey );
    config.setMaxTotal( maxTotalPerKey );
    config.setMinIdlePerKey( minIdlePerKey );
    config.setMaxIdlePerKey( maxIdlePerKey );
    config.setBlockWhenExhausted( false );

    pool =
        new GenericKeyedObjectPool<String, ThreadLimitExecuterServiceObject>( new ThreadLimitExecuterServiceObjectFactory(),
                                                                              config );

}
 
开发者ID:vmware,项目名称:OHMS,代码行数:18,代码来源:ThreadLimitExecuterServiceObjectPool.java

示例4: registerPool

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
private void registerPool(final String username, final String password)
        throws NamingException, SQLException {

    final ConnectionPoolDataSource cpds = testCPDS(username, password);

    // Create an object pool to contain our PooledConnections
    factory = new KeyedCPDSConnectionFactory(cpds, getValidationQuery(),
            getValidationQueryTimeout(), isRollbackAfterValidation());
    factory.setMaxConnLifetimeMillis(getMaxConnLifetimeMillis());

    final GenericKeyedObjectPoolConfig config =
            new GenericKeyedObjectPoolConfig();
    config.setBlockWhenExhausted(getDefaultBlockWhenExhausted());
    config.setEvictionPolicyClassName(getDefaultEvictionPolicyClassName());
    config.setLifo(getDefaultLifo());
    config.setMaxIdlePerKey(getDefaultMaxIdle());
    config.setMaxTotal(getMaxTotal());
    config.setMaxTotalPerKey(getDefaultMaxTotal());
    config.setMaxWaitMillis(getDefaultMaxWaitMillis());
    config.setMinEvictableIdleTimeMillis(
            getDefaultMinEvictableIdleTimeMillis());
    config.setMinIdlePerKey(getDefaultMinIdle());
    config.setNumTestsPerEvictionRun(getDefaultNumTestsPerEvictionRun());
    config.setSoftMinEvictableIdleTimeMillis(
            getDefaultSoftMinEvictableIdleTimeMillis());
    config.setTestOnCreate(getDefaultTestOnCreate());
    config.setTestOnBorrow(getDefaultTestOnBorrow());
    config.setTestOnReturn(getDefaultTestOnReturn());
    config.setTestWhileIdle(getDefaultTestWhileIdle());
    config.setTimeBetweenEvictionRunsMillis(
            getDefaultTimeBetweenEvictionRunsMillis());

    final KeyedObjectPool<UserPassKey,PooledConnectionAndInfo> tmpPool =
            new GenericKeyedObjectPool<>(factory, config);
    factory.setPool(tmpPool);
    pool = tmpPool;
}
 
开发者ID:apache,项目名称:commons-dbcp,代码行数:38,代码来源:SharedPoolDataSource.java

示例5: makeObject

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
/**
 * Uses the configured XAConnectionFactory to create a {@link PoolableManagedConnection}.
 * Throws <code>IllegalStateException</code> if the connection factory returns null.
 * Also initializes the connection using configured initialization sql (if provided)
 * and sets up a prepared statement pool associated with the PoolableManagedConnection
 * if statement pooling is enabled.
 */
@Override
synchronized public PooledObject<PoolableConnection> makeObject() throws Exception {
    Connection conn = getConnectionFactory().createConnection();
    if (conn == null) {
        throw new IllegalStateException("Connection factory returned null from createConnection");
    }
    initializeConnection(conn);
    if (getPoolStatements()) {
        conn = new PoolingConnection(conn);
        final GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
        config.setMaxTotalPerKey(-1);
        config.setBlockWhenExhausted(false);
        config.setMaxWaitMillis(0);
        config.setMaxIdlePerKey(1);
        config.setMaxTotal(getMaxOpenPreparedStatements());
        final ObjectName dataSourceJmxName = getDataSourceJmxName();
        final long connIndex = getConnectionIndex().getAndIncrement();
        if (dataSourceJmxName != null) {
            final StringBuilder base = new StringBuilder(dataSourceJmxName.toString());
            base.append(Constants.JMX_CONNECTION_BASE_EXT);
            base.append(Long.toString(connIndex));
            config.setJmxNameBase(base.toString());
            config.setJmxNamePrefix(Constants.JMX_STATEMENT_POOL_PREFIX);
        } else {
            config.setJmxEnabled(false);
        }
        final KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> stmtPool =
            new GenericKeyedObjectPool<>((PoolingConnection)conn, config);
        ((PoolingConnection)conn).setStatementPool(stmtPool);
        ((PoolingConnection) conn).setCacheState(getCacheState());
    }
    final PoolableManagedConnection pmc =
            new PoolableManagedConnection(transactionRegistry, conn, getPool(),
                    getDisconnectionSqlCodes(), isFastFailValidation());
    pmc.setCacheState(getCacheState());
    return new DefaultPooledObject<PoolableConnection>(pmc);
}
 
开发者ID:apache,项目名称:commons-dbcp,代码行数:45,代码来源:PoolableManagedConnectionFactory.java

示例6: setUp

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
    con = new PoolingConnection(new TesterConnection("test", "test"));
    final GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
    config.setMaxTotalPerKey(-1);
    config.setBlockWhenExhausted(false);
    config.setMaxWaitMillis(0);
    config.setMaxIdlePerKey(1);
    config.setMaxTotal(1);
    final KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> stmtPool =
            new GenericKeyedObjectPool<>(con, config);
    con.setStatementPool(stmtPool);
}
 
开发者ID:apache,项目名称:commons-dbcp,代码行数:14,代码来源:TestPoolingConnection.java

示例7: getConfig

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
private GenericKeyedObjectPoolConfig getConfig(PoolConfig poolConfig) {
	GenericKeyedObjectPoolConfig objectPoolConfig = new GenericKeyedObjectPoolConfig();

	objectPoolConfig.setMaxTotalPerKey(poolConfig.getMaxTotalPerKey());
	objectPoolConfig.setMaxTotal(poolConfig.getMaxTotal());

	objectPoolConfig.setMaxIdlePerKey(poolConfig.getMaxIdlePerKey());
	objectPoolConfig.setMinIdlePerKey(poolConfig.getMinIdlePerKey());

	objectPoolConfig.setTestWhileIdle(poolConfig.isTestWhileIdle());
	objectPoolConfig.setTestOnReturn(poolConfig.isTestOnReturn());
	objectPoolConfig.setTestOnCreate(poolConfig.isTestOnCreate());
	objectPoolConfig.setTestOnBorrow(poolConfig.isTestOnBorrow());

	objectPoolConfig.setTimeBetweenEvictionRunsMillis(poolConfig.getTimeBetweenEvictionRunsMillis());
	objectPoolConfig.setEvictionPolicyClassName(poolConfig.getEvictionPolicyClassName());
	objectPoolConfig.setMinEvictableIdleTimeMillis(poolConfig.getMinEvictableIdleTimeMillis());
	objectPoolConfig.setNumTestsPerEvictionRun(poolConfig.getNumTestsPerEvictionRun());
	objectPoolConfig.setSoftMinEvictableIdleTimeMillis(poolConfig.getSoftMinEvictableIdleTimeMillis());

	objectPoolConfig.setJmxEnabled(poolConfig.isJmxEnabled());
	objectPoolConfig.setJmxNameBase(poolConfig.getJmxNameBase());
	objectPoolConfig.setJmxNamePrefix(poolConfig.getJmxNamePrefix());

	objectPoolConfig.setMaxWaitMillis(poolConfig.getMaxWaitMillis());

	objectPoolConfig.setFairness(poolConfig.isFairness());
	objectPoolConfig.setBlockWhenExhausted(poolConfig.isBlockWhenExhausted());
	objectPoolConfig.setLifo(poolConfig.isLifo());

	return objectPoolConfig;
}
 
开发者ID:spring-projects,项目名称:spring-ldap,代码行数:33,代码来源:PooledContextSource.java

示例8: ThriftConnectionPool

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
public ThriftConnectionPool(Class<T> cls, ThriftPoolConfig cfg,ThriftConnectionFactory connectionFactory) {
    this.clientClass = cls;
    this.cfg = cfg;
    poolConfig = new GenericKeyedObjectPoolConfig();
    poolConfig.setLifo(cfg.getBoolean("thrift.pool.lifo", false));
    poolConfig.setMaxTotal(cfg.getInt("thrift.pool.maxActive", 10));
    poolConfig.setMaxIdlePerKey(cfg.getInt("thrift.pool.maxIdlePerKey", 3));
    poolConfig.setMinIdlePerKey(cfg.getInt("thrift.pool.minIdlePerKey", 0));
    poolConfig.setMaxTotalPerKey(cfg.getInt("thrift.pool.maxTotalPerKey", 10));

    /**
     set the maximum amount of time (in milliseconds) the
     <code>borrowObject()</code> method should block before throwing an
     exception when the pool is exhausted and {@link #getBlockWhenExhausted} is true.
     When less than 0, the <code>borrowObject()</code> method may block indefinitely.
     */
    poolConfig.setMaxWaitMillis(cfg.getInt("thrift.pool.maxWait",20 * 1000));
    /**
     Sets whether to block when the <code>borrowObject()</code> method is
     invoked when the pool is exhausted (the maximum number of "active"
     objects has been reached).
     */
    poolConfig.setBlockWhenExhausted(true);
    /**为了提升性能 关闭testOnBorrow**/
    poolConfig.setTestOnBorrow(false);
    poolConfig.setTestWhileIdle(true);

    this.loop = cfg.getBoolean("thrift.pool.get.loop",false);

    // 开启一个线程执行扫描检测connection
    poolConfig.setTimeBetweenEvictionRunsMillis(cfg.getInt("thrift.pool.timeBetweenEvictionRunsMillis",3*60*1000));
    poolConfig.setMinEvictableIdleTimeMillis(cfg.getInt("thrift.pool.minEvictableIdleTimeMillis",5*60*1000));
    poolConfig.setNumTestsPerEvictionRun(cfg.getInt("thrift.pool.numTestsPerEvictionRun",3));
    this.factory = connectionFactory;
    this.factory.setPool(this);
    mPool = new GenericKeyedObjectPool<>(factory, poolConfig);
}
 
开发者ID:houdejun214,项目名称:lakeside-java,代码行数:38,代码来源:ThriftConnectionPool.java

示例9: createDefaultConfig

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
private static GenericKeyedObjectPoolConfig createDefaultConfig(int maxPerKey) {
	GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
	config.setMaxTotalPerKey(maxPerKey);
	config.setBlockWhenExhausted(false);
	return config;
}
 
开发者ID:ctripcorp,项目名称:x-pipe,代码行数:7,代码来源:XpipeNettyClientKeyedObjectPool.java

示例10: initTask

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
@Override
public void initTask() {
  super.initTask();
  stageClassLoaders = runtimeInfo.getStageLibraryClassLoaders();
  if (!stageClassLoaders.isEmpty()) {
    resolveClassLoaderMethods(stageClassLoaders.get(0));
  }

  if(configuration.get(CONFIG_CP_VALIDATION, DEFAULT_CP_VALIDATION)) {
    validateStageClasspaths();
  }

  // Load all stages and other objects from the libraries
  json = ObjectMapperFactory.get();
  stageList = new ArrayList<>();
  stageMap = new HashMap<>();
  lineagePublisherDefinitions = new ArrayList<>();
  lineagePublisherDefinitionMap = new HashMap<>();
  credentialStoreDefinitions = new ArrayList<>();
  serviceList = new ArrayList<>();
  serviceMap = new HashMap<>();
  loadStages();
  stageList = ImmutableList.copyOf(stageList);
  stageMap = ImmutableMap.copyOf(stageMap);
  lineagePublisherDefinitions = ImmutableList.copyOf(lineagePublisherDefinitions);
  lineagePublisherDefinitionMap = ImmutableMap.copyOf(lineagePublisherDefinitionMap);
  credentialStoreDefinitions = ImmutableList.copyOf(credentialStoreDefinitions);
  serviceList = ImmutableList.copyOf(serviceList);
  serviceMap = ImmutableMap.copyOf(serviceMap);

  // Various validations
  validateAllServicesAvailable();

  // localization cache for definitions
  localizedStageList = CacheBuilder.newBuilder().build(new CacheLoader<Locale, List<StageDefinition>>() {
    @Override
    public List<StageDefinition> load(Locale key) throws Exception {
      List<StageDefinition> list = new ArrayList<>();
      for (StageDefinition stage : stageList) {
        list.add(stage.localize());
      }
      return list;
    }
  });
  validateStageVersions(stageList);
  validateServices(stageList, serviceList);

  // initializing the list of targets that can be used for error handling
  ErrorHandlingChooserValues.setErrorHandlingOptions(this);

  // initializing the list of targets that can be used as aggregating sink
  StatsTargetChooserValues.setStatsTargetOptions(this);

  // initializing the list of targets that can be used for pipeline lifecycle events
  PipelineLifecycleStageChooserValues.setHandlingOptions(this);

  // initializing the pool of private stage classloaders
  GenericKeyedObjectPoolConfig poolConfig = new GenericKeyedObjectPoolConfig();
  poolConfig.setJmxEnabled(false);
  poolConfig.setMaxTotal(configuration.get(MAX_PRIVATE_STAGE_CLASS_LOADERS_KEY,
                                           MAX_PRIVATE_STAGE_CLASS_LOADERS_DEFAULT));
  poolConfig.setMinEvictableIdleTimeMillis(-1);
  poolConfig.setNumTestsPerEvictionRun(0);
  poolConfig.setMaxIdlePerKey(-1);
  poolConfig.setMinIdlePerKey(0);
  poolConfig.setMaxTotalPerKey(-1);
  poolConfig.setBlockWhenExhausted(false);
  poolConfig.setMaxWaitMillis(0);
  privateClassLoaderPool = new GenericKeyedObjectPool<>(new ClassLoaderFactory(stageClassLoaders), poolConfig);
}
 
开发者ID:streamsets,项目名称:datacollector,代码行数:71,代码来源:ClassLoaderStageLibraryTask.java

示例11: getPooledConnection

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
/**
 * Attempt to establish a database connection.
 * @param username name to be used for the connection
 * @param pass password to be used fur the connection
 */
@Override
public PooledConnection getPooledConnection(final String username, final String pass)
        throws SQLException {
    getConnectionCalled = true;
    PooledConnectionImpl pci = null;
    // Workaround for buggy WebLogic 5.1 classloader - ignore the
    // exception upon first invocation.
    try {
        if (connectionProperties != null) {
            connectionProperties.put("user", username);
            connectionProperties.put("password", pass);
            pci = new PooledConnectionImpl(DriverManager.getConnection(
                    getUrl(), connectionProperties));
        } else {
            pci = new PooledConnectionImpl(DriverManager.getConnection(
                    getUrl(), username, pass));
        }
        pci.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed());
    }
    catch (final ClassCircularityError e)
    {
        if (connectionProperties != null) {
            pci = new PooledConnectionImpl(DriverManager.getConnection(
                    getUrl(), connectionProperties));
        } else {
            pci = new PooledConnectionImpl(DriverManager.getConnection(
                    getUrl(), username, pass));
        }
        pci.setAccessToUnderlyingConnectionAllowed(isAccessToUnderlyingConnectionAllowed());
    }
    KeyedObjectPool<PStmtKeyCPDS, PoolablePreparedStatement<PStmtKeyCPDS>> stmtPool = null;
    if (isPoolPreparedStatements()) {
        final GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
        config.setMaxTotalPerKey(Integer.MAX_VALUE);
        config.setBlockWhenExhausted(false);
        config.setMaxWaitMillis(0);
        config.setMaxIdlePerKey(getMaxIdle());
        if (getMaxPreparedStatements() <= 0)
        {
            // since there is no limit, create a prepared statement pool with an eviction thread
            //  evictor settings are the same as the connection pool settings.
            config.setTimeBetweenEvictionRunsMillis(getTimeBetweenEvictionRunsMillis());
            config.setNumTestsPerEvictionRun(getNumTestsPerEvictionRun());
            config.setMinEvictableIdleTimeMillis(getMinEvictableIdleTimeMillis());
        }
        else
        {
            // since there is limit, create a prepared statement pool without an eviction thread
            //  pool has LRU functionality so when the limit is reached, 15% of the pool is cleared.
            // see org.apache.commons.pool2.impl.GenericKeyedObjectPool.clearOldest method
            config.setMaxTotal(getMaxPreparedStatements());
            config.setTimeBetweenEvictionRunsMillis(-1);
            config.setNumTestsPerEvictionRun(0);
            config.setMinEvictableIdleTimeMillis(0);
        }
        stmtPool = new GenericKeyedObjectPool<>(pci, config);
        pci.setStatementPool(stmtPool);
    }
    return pci;
}
 
开发者ID:apache,项目名称:commons-dbcp,代码行数:66,代码来源:DriverAdapterCPDS.java

示例12: makeObject

import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig; //导入方法依赖的package包/类
@Override
public PooledObject<PoolableConnection> makeObject() throws Exception {
    Connection conn = _connFactory.createConnection();
    if (conn == null) {
        throw new IllegalStateException("Connection factory returned null from createConnection");
    }
    try {
        initializeConnection(conn);
    } catch (final SQLException sqle) {
        // Make sure the connection is closed
        try {
            conn.close();
        } catch (final SQLException ignore) {
            // ignore
        }
        // Rethrow original exception so it is visible to caller
        throw sqle;
    }

    final long connIndex = connectionIndex.getAndIncrement();

    if(poolStatements) {
        conn = new PoolingConnection(conn);
        final GenericKeyedObjectPoolConfig config = new GenericKeyedObjectPoolConfig();
        config.setMaxTotalPerKey(-1);
        config.setBlockWhenExhausted(false);
        config.setMaxWaitMillis(0);
        config.setMaxIdlePerKey(1);
        config.setMaxTotal(maxOpenPreparedStatements);
        if (dataSourceJmxName != null) {
            final StringBuilder base = new StringBuilder(dataSourceJmxName.toString());
            base.append(Constants.JMX_CONNECTION_BASE_EXT);
            base.append(Long.toString(connIndex));
            config.setJmxNameBase(base.toString());
            config.setJmxNamePrefix(Constants.JMX_STATEMENT_POOL_PREFIX);
        } else {
            config.setJmxEnabled(false);
        }
        final KeyedObjectPool<PStmtKey,DelegatingPreparedStatement> stmtPool =
                new GenericKeyedObjectPool<>((PoolingConnection)conn, config);
        ((PoolingConnection)conn).setStatementPool(stmtPool);
        ((PoolingConnection) conn).setCacheState(_cacheState);
    }

    // Register this connection with JMX
    ObjectName connJmxName;
    if (dataSourceJmxName == null) {
        connJmxName = null;
    } else {
        connJmxName = new ObjectName(dataSourceJmxName.toString() +
                Constants.JMX_CONNECTION_BASE_EXT + connIndex);
    }

    final PoolableConnection pc = new PoolableConnection(conn, _pool, connJmxName,
                                  _disconnectionSqlCodes, _fastFailValidation);
    pc.setCacheState(_cacheState);

    return new DefaultPooledObject<>(pc);
}
 
开发者ID:apache,项目名称:commons-dbcp,代码行数:60,代码来源:PoolableConnectionFactory.java


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