Java Doc for CommonsPoolTargetSource.java in  » J2EE » spring-framework-2.0.6 » org » springframework » aop » target » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » J2EE » spring framework 2.0.6 » org.springframework.aop.target 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
      org.springframework.aop.target.AbstractPrototypeBasedTargetSource
         org.springframework.aop.target.AbstractPoolingTargetSource
            org.springframework.aop.target.CommonsPoolTargetSource

CommonsPoolTargetSource
public class CommonsPoolTargetSource extends AbstractPoolingTargetSource implements PoolableObjectFactory(Code)
TargetSource implementation that holds objects in a configurable Jakarta Commons Pool.

By default, an instance of GenericObjectPool is created. Subclasses may change the type of ObjectPool used by overriding the createObjectPool() method.

Provides many configuration properties mirroring those of the Commons Pool GenericObjectPool class; these properties are passed to the GenericObjectPool during construction. If creating a subclass of this class to change the ObjectPool implementation type, pass in the values of configuration properties that are relevant to your chosen implementation.

The testOnBorrow, testOnReturn and testWhileIdle properties are explictly not mirrored because the implementation of PoolableObjectFactory used by this class does not implement meaningful validation. All exposed Commons Pool properties use the corresponding Commons Pool defaults: for example,
author:
   Rod Johnson
author:
   Rob Harrop
author:
   Juergen Hoeller
See Also:   GenericObjectPool
See Also:   CommonsPoolTargetSource.createObjectPool()
See Also:   CommonsPoolTargetSource.setMaxSize
See Also:   CommonsPoolTargetSource.setMaxIdle
See Also:   CommonsPoolTargetSource.setMinIdle
See Also:   CommonsPoolTargetSource.setMaxWait
See Also:   CommonsPoolTargetSource.setTimeBetweenEvictionRunsMillis
See Also:   CommonsPoolTargetSource.setMinEvictableIdleTimeMillis




Constructor Summary
public  CommonsPoolTargetSource()
     Create a CommonsPoolTargetSource with default settings.

Method Summary
public  voidactivateObject(Object obj)
    
protected  ObjectPoolcreateObjectPool()
     Subclasses can override this if they want to return a specific Commons pool.
final protected  voidcreatePool()
     Creates and holds an ObjectPool instance.
public  voiddestroy()
     Closes the underlying ObjectPool when destroying this object.
public  voiddestroyObject(Object obj)
    
public  intgetActiveCount()
    
public  intgetIdleCount()
    
public  intgetMaxIdle()
     Return the maximum number of idle objects in the pool.
public  longgetMaxWait()
     Return the maximum waiting time for fetching an object from the pool.
public  longgetMinEvictableIdleTimeMillis()
     Return the minimum time that an idle object can sit in the pool.
public  intgetMinIdle()
     Return the minimum number of idle objects in the pool.
public  ObjectgetTarget()
     Borrow an object from the ObjectPool.
public  longgetTimeBetweenEvictionRunsMillis()
     Return the time between eviction runs that check idle objects.
public  bytegetWhenExhaustedAction()
     Return the action to take when the pool is exhausted.
public  ObjectmakeObject()
    
public  voidpassivateObject(Object obj)
    
public  voidreleaseTarget(Object target)
     Returns the specified object to the underlying ObjectPool.
public  voidsetMaxIdle(int maxIdle)
     Set the maximum number of idle objects in the pool.
public  voidsetMaxWait(long maxWait)
     Set the maximum waiting time for fetching an object from the pool.
public  voidsetMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
     Set the minimum time that an idle object can sit in the pool before it becomes subject to eviction.
public  voidsetMinIdle(int minIdle)
     Set the minimum number of idle objects in the pool.
public  voidsetTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
     Set the time between eviction runs that check idle objects whether they have been idle for too long or have become invalid.
public  voidsetWhenExhaustedAction(byte whenExhaustedAction)
     Set the action to take when the pool is exhausted.
public  voidsetWhenExhaustedActionName(String whenExhaustedActionName)
     Set the action to take when the pool is exhausted.
public  booleanvalidateObject(Object obj)
    


Constructor Detail
CommonsPoolTargetSource
public CommonsPoolTargetSource()(Code)
Create a CommonsPoolTargetSource with default settings. Default maximum size of the pool is 8.
See Also:   CommonsPoolTargetSource.setMaxSize
See Also:   GenericObjectPool.setMaxActive




Method Detail
activateObject
public void activateObject(Object obj)(Code)



createObjectPool
protected ObjectPool createObjectPool()(Code)
Subclasses can override this if they want to return a specific Commons pool. They should apply any configuration properties to the pool here.

Default is a GenericObjectPool instance with the given pool size. an empty Commons ObjectPool.
See Also:   org.apache.commons.pool.impl.GenericObjectPool
See Also:   CommonsPoolTargetSource.setMaxSize




createPool
final protected void createPool()(Code)
Creates and holds an ObjectPool instance.
See Also:   CommonsPoolTargetSource.createObjectPool()



destroy
public void destroy() throws Exception(Code)
Closes the underlying ObjectPool when destroying this object.



destroyObject
public void destroyObject(Object obj) throws Exception(Code)



getActiveCount
public int getActiveCount() throws UnsupportedOperationException(Code)



getIdleCount
public int getIdleCount() throws UnsupportedOperationException(Code)



getMaxIdle
public int getMaxIdle()(Code)
Return the maximum number of idle objects in the pool.



getMaxWait
public long getMaxWait()(Code)
Return the maximum waiting time for fetching an object from the pool.



getMinEvictableIdleTimeMillis
public long getMinEvictableIdleTimeMillis()(Code)
Return the minimum time that an idle object can sit in the pool.



getMinIdle
public int getMinIdle()(Code)
Return the minimum number of idle objects in the pool.



getTarget
public Object getTarget() throws Exception(Code)
Borrow an object from the ObjectPool.



getTimeBetweenEvictionRunsMillis
public long getTimeBetweenEvictionRunsMillis()(Code)
Return the time between eviction runs that check idle objects.



getWhenExhaustedAction
public byte getWhenExhaustedAction()(Code)
Return the action to take when the pool is exhausted.



makeObject
public Object makeObject() throws BeansException(Code)



passivateObject
public void passivateObject(Object obj)(Code)



releaseTarget
public void releaseTarget(Object target) throws Exception(Code)
Returns the specified object to the underlying ObjectPool.



setMaxIdle
public void setMaxIdle(int maxIdle)(Code)
Set the maximum number of idle objects in the pool. Default is 8.
See Also:   GenericObjectPool.setMaxIdle



setMaxWait
public void setMaxWait(long maxWait)(Code)
Set the maximum waiting time for fetching an object from the pool. Default is -1, waiting forever.
See Also:   GenericObjectPool.setMaxWait



setMinEvictableIdleTimeMillis
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)(Code)
Set the minimum time that an idle object can sit in the pool before it becomes subject to eviction. Default is 1800000 (30 minutes).

Note that eviction runs need to be performed to take this setting into effect.
See Also:   CommonsPoolTargetSource.setTimeBetweenEvictionRunsMillis
See Also:   GenericObjectPool.setMinEvictableIdleTimeMillis




setMinIdle
public void setMinIdle(int minIdle)(Code)
Set the minimum number of idle objects in the pool. Default is 0.
See Also:   GenericObjectPool.setMinIdle



setTimeBetweenEvictionRunsMillis
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)(Code)
Set the time between eviction runs that check idle objects whether they have been idle for too long or have become invalid. Default is -1, not performing any eviction.
See Also:   GenericObjectPool.setTimeBetweenEvictionRunsMillis



setWhenExhaustedAction
public void setWhenExhaustedAction(byte whenExhaustedAction)(Code)
Set the action to take when the pool is exhausted. Uses the constant values defined in Commons Pool's GenericObjectPool class.
See Also:   GenericObjectPool.setWhenExhaustedAction(byte)
See Also:   GenericObjectPool.WHEN_EXHAUSTED_BLOCK
See Also:   GenericObjectPool.WHEN_EXHAUSTED_FAIL
See Also:   GenericObjectPool.WHEN_EXHAUSTED_GROW



setWhenExhaustedActionName
public void setWhenExhaustedActionName(String whenExhaustedActionName)(Code)
Set the action to take when the pool is exhausted. Uses the constant names defined in Commons Pool's GenericObjectPool class: "WHEN_EXHAUSTED_BLOCK", "WHEN_EXHAUSTED_FAIL", "WHEN_EXHAUSTED_GROW".
See Also:   CommonsPoolTargetSource.setWhenExhaustedAction(byte)



validateObject
public boolean validateObject(Object obj)(Code)



Methods inherited from org.springframework.aop.target.AbstractPoolingTargetSource
abstract protected void createPool() throws Exception(Code)(Java Doc)
public int getMaxSize()(Code)(Java Doc)
public DefaultIntroductionAdvisor getPoolingConfigMixin()(Code)(Java Doc)
abstract public Object getTarget() throws Exception(Code)(Java Doc)
abstract public void releaseTarget(Object target) throws Exception(Code)(Java Doc)
final public void setBeanFactory(BeanFactory beanFactory) throws BeansException(Code)(Java Doc)
public void setMaxSize(int maxSize)(Code)(Java Doc)

Methods inherited from org.springframework.aop.target.AbstractPrototypeBasedTargetSource
protected void destroyPrototypeInstance(Object target)(Code)(Java Doc)
protected Object newPrototypeInstance() throws BeansException(Code)(Java Doc)
public void setBeanFactory(BeanFactory beanFactory) throws BeansException(Code)(Java Doc)

Fields inherited from org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
final protected Log logger(Code)(Java Doc)

Methods inherited from org.springframework.aop.target.AbstractBeanFactoryBasedTargetSource
protected void copyFrom(AbstractBeanFactoryBasedTargetSource other)(Code)(Java Doc)
public boolean equals(Object other)(Code)(Java Doc)
public BeanFactory getBeanFactory()(Code)(Java Doc)
public String getTargetBeanName()(Code)(Java Doc)
public synchronized Class getTargetClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isStatic()(Code)(Java Doc)
public void releaseTarget(Object target) throws Exception(Code)(Java Doc)
public void setBeanFactory(BeanFactory beanFactory) throws BeansException(Code)(Java Doc)
public void setTargetBeanName(String targetBeanName)(Code)(Java Doc)
public void setTargetClass(Class targetClass)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
protected Object writeReplace() throws ObjectStreamException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.