本文整理汇总了Java中org.ldaptive.pool.BlockingConnectionPool类的典型用法代码示例。如果您正苦于以下问题:Java BlockingConnectionPool类的具体用法?Java BlockingConnectionPool怎么用?Java BlockingConnectionPool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockingConnectionPool类属于org.ldaptive.pool包,在下文中一共展示了BlockingConnectionPool类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: newConnectionPool
import org.ldaptive.pool.BlockingConnectionPool; //导入依赖的package包/类
/**
* Creates a new instance of a connection pool. Copied from {@link #connectionPool}.
*
* @param ldapURL to connect to
* @return connection pool
*/
private ConnectionPool newConnectionPool(final String ldapURL) {
final BlockingConnectionPool pool = new BlockingConnectionPool(
newPoolConfig(this.connectionPool.getPoolConfig()),
(DefaultConnectionFactory) super.prepareConnectionFactory(ldapURL));
pool.setBlockWaitTime(this.connectionPool.getBlockWaitTime());
pool.setActivator(this.connectionPool.getActivator());
pool.setPassivator(this.connectionPool.getPassivator());
pool.setValidator(this.connectionPool.getValidator());
pool.setConnectOnCreate(this.connectionPool.getConnectOnCreate());
pool.setFailFastInitialize(this.connectionPool.getFailFastInitialize());
pool.setName(String.format("x509-crl-%s", ldapURL));
pool.setPruneStrategy(this.connectionPool.getPruneStrategy());
pool.initialize();
return pool;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:22,代码来源:PoolingLdaptiveResourceCRLFetcher.java
示例2: PoolingLdaptiveResourceCRLFetcher
import org.ldaptive.pool.BlockingConnectionPool; //导入依赖的package包/类
/**
* Instantiates a new Ldap resource cRL fetcher.
* @param connectionConfig the connection configuration
* @param searchExecutor the search executor
* @param connectionPool pooling configuration
*/
public PoolingLdaptiveResourceCRLFetcher(
@NotNull final ConnectionConfig connectionConfig,
@NotNull final SearchExecutor searchExecutor,
@NotNull final BlockingConnectionPool connectionPool) {
super(connectionConfig, searchExecutor);
this.connectionPool = connectionPool;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:15,代码来源:PoolingLdaptiveResourceCRLFetcher.java
示例3: connectionPool
import org.ldaptive.pool.BlockingConnectionPool; //导入依赖的package包/类
private ConnectionPool connectionPool(Provider<?> provider) {
BlockingConnectionPool pool = new BlockingConnectionPool();
pool.setConnectionFactory(defaultConnectionFactory(provider));
pool.setPoolConfig(poolConfig());
pool.setPruneStrategy(pruneStrategy());
pool.setValidator(searchValidator());
int a = 0;
// TODO new in 1.2
//pool.setBlockWaitTime(properties.getBlockWaitTime());
pool.initialize();
return pool;
}
开发者ID:bremersee,项目名称:fac,代码行数:13,代码来源:LdaptiveConfig.java
示例4: connect
import org.ldaptive.pool.BlockingConnectionPool; //导入依赖的package包/类
public void connect() {
this.config = new ConnectionConfig();
this.config.setLdapUrl(this.url);
this.config.setUseSSL(this.ssl);
this.config.setConnectionInitializer(new BindConnectionInitializer(user, new Credential(password)));
this.pool = new BlockingConnectionPool(new DefaultConnectionFactory(this.config));
if (!this.pool.isInitialized()) {
this.pool.initialize();
}
this.connFactory = new PooledConnectionFactory(this.pool);
}
开发者ID:Stratio,项目名称:bdt,代码行数:12,代码来源:LdapUtils.java
示例5: setConnectionPool
import org.ldaptive.pool.BlockingConnectionPool; //导入依赖的package包/类
@Autowired(required=false)
public void setConnectionPool(@Qualifier("poolingLdaptiveConnectionPool") final BlockingConnectionPool connectionPool) {
this.connectionPool = connectionPool;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:5,代码来源:PoolingLdaptiveResourceCRLFetcher.java
示例6: newLdaptiveBlockingConnectionPool
import org.ldaptive.pool.BlockingConnectionPool; //导入依赖的package包/类
/**
* New blocking connection pool connection pool.
*
* @param l the l
* @return the connection pool
*/
public static ConnectionPool newLdaptiveBlockingConnectionPool(final AbstractLdapProperties l) {
final DefaultConnectionFactory bindCf = newLdaptiveConnectionFactory(l);
final PoolConfig pc = newLdaptivePoolConfig(l);
final BlockingConnectionPool cp = new BlockingConnectionPool(pc, bindCf);
cp.setBlockWaitTime(newDuration(l.getBlockWaitTime()));
cp.setPoolConfig(pc);
final IdlePruneStrategy strategy = new IdlePruneStrategy();
strategy.setIdleTime(newDuration(l.getIdleTime()));
strategy.setPrunePeriod(newDuration(l.getPrunePeriod()));
cp.setPruneStrategy(strategy);
switch (l.getValidator().getType().trim().toLowerCase()) {
case "compare":
final CompareRequest compareRequest = new CompareRequest();
compareRequest.setDn(l.getValidator().getDn());
compareRequest.setAttribute(new LdapAttribute(l.getValidator().getAttributeName(),
l.getValidator().getAttributeValues().toArray(new String[]{})));
compareRequest.setReferralHandler(new SearchReferralHandler());
cp.setValidator(new CompareValidator(compareRequest));
break;
case "none":
LOGGER.debug("No validator is configured for the LDAP connection pool of [{}]", l.getLdapUrl());
break;
case "search":
default:
final SearchRequest searchRequest = new SearchRequest();
searchRequest.setBaseDn(l.getValidator().getBaseDn());
searchRequest.setSearchFilter(new SearchFilter(l.getValidator().getSearchFilter()));
searchRequest.setReturnAttributes(ReturnAttributes.NONE.value());
searchRequest.setSearchScope(l.getValidator().getScope());
searchRequest.setSizeLimit(1L);
searchRequest.setReferralHandler(new SearchReferralHandler());
cp.setValidator(new SearchValidator(searchRequest));
break;
}
cp.setFailFastInitialize(l.isFailFast());
if (StringUtils.isNotBlank(l.getPoolPassivator())) {
final AbstractLdapProperties.LdapConnectionPoolPassivator pass =
AbstractLdapProperties.LdapConnectionPoolPassivator.valueOf(l.getPoolPassivator().toUpperCase());
switch (pass) {
case CLOSE:
cp.setPassivator(new ClosePassivator());
LOGGER.debug("Created [{}] passivator for [{}]", l.getPoolPassivator(), l.getLdapUrl());
break;
case BIND:
if (StringUtils.isNotBlank(l.getBindDn()) && StringUtils.isNoneBlank(l.getBindCredential())) {
final BindRequest bindRequest = new BindRequest();
bindRequest.setDn(l.getBindDn());
bindRequest.setCredential(new Credential(l.getBindCredential()));
cp.setPassivator(new BindPassivator(bindRequest));
LOGGER.debug("Created [{}] passivator for [{}]", l.getPoolPassivator(), l.getLdapUrl());
} else {
LOGGER.warn("No [{}] passivator could be created for [{}] given bind credentials are not specified",
l.getPoolPassivator(), l.getLdapUrl());
}
break;
default:
break;
}
}
LOGGER.debug("Initializing ldap connection pool for [{}] and bindDn [{}]", l.getLdapUrl(), l.getBindDn());
cp.initialize();
return cp;
}
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:77,代码来源:Beans.java
注:本文中的org.ldaptive.pool.BlockingConnectionPool类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论