Spring Framework CommonsPoolTargetSource - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework CommonsPoolTargetSource class.

This code example shows how to use the following methods:setMaxSize
	@Override 
	protected final AbstractBeanFactoryBasedTargetSource createBeanFactoryBasedTargetSource(
			Class<?> beanClass, String beanName) {
 
		if (beanName.startsWith(PREFIX_COMMONS_POOL)) {
			CommonsPoolTargetSource cpts = new CommonsPoolTargetSource();
			cpts.setMaxSize(25);
			return cpts;
		} 
		else if (beanName.startsWith(PREFIX_THREAD_LOCAL)) {
			return new ThreadLocalTargetSource();
		} 
		else if (beanName.startsWith(PREFIX_PROTOTYPE)) {
			return new PrototypeTargetSource();
		} 
		else { 
			// No match. Don't create a custom target source. 
			return null; 
		} 
	} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getTarget
    @Override 
    public Object getTarget() throws Exception {
        numWaitingCallers.incrementAndGet();
 
        try { 
            return super.getTarget(); 
        } finally { 
            numWaitingCallers.decrementAndGet();
        } 
    } 
 
    @ManagedAttribute 
    public int getNumWaitingCallers() { 
        return numWaitingCallers.get();
    } 
 
    @Override 
    @ManagedAttribute 
    public int getActiveCount() { 
        return super.getActiveCount(); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getTarget
    @Override 
    public Object getTarget() throws Exception {
        numWaitingCallers.incrementAndGet();
 
        try { 
            return super.getTarget(); 
        } finally { 
            numWaitingCallers.decrementAndGet();
        } 
    } 
 
    @ManagedAttribute 
    public int getNumWaitingCallers() { 
        return numWaitingCallers.get();
    } 
 
    @Override 
    @ManagedAttribute 
    public int getActiveCount() { 
        return super.getActiveCount(); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework CommonsPoolTargetSource Methods: