Java Doc for PoolUtils.java in  » Database-JDBC-Connection-Pool » Apache-commons-pool-1.3 » org » apache » commons » pool » 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 » Database JDBC Connection Pool » Apache commons pool 1.3 » org.apache.commons.pool 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.pool.PoolUtils

PoolUtils
final public class PoolUtils (Code)
This class consists exclusively of static methods that operate on or return keyedPool related interfaces.
author:
   Sandy McArthur
version:
   $Revision: 385296 $ $Date: 2006-03-12 10:28:08 -0500 (Sun, 12 Mar 2006) $
since:
   Pool 1.3



Constructor Summary
public  PoolUtils()
     PoolUtils instances should NOT be constructed in standard programming.

Method Summary
public static  PoolableObjectFactoryadapt(KeyedPoolableObjectFactory keyedFactory)
     Adapt a KeyedPoolableObjectFactory instance to work where a PoolableObjectFactory is needed.
public static  PoolableObjectFactoryadapt(KeyedPoolableObjectFactory keyedFactory, Object key)
     Adapt a KeyedPoolableObjectFactory instance to work where a PoolableObjectFactory is needed using the specified key when delegating.
Parameters:
  keyedFactory - the KeyedPoolableObjectFactory to delegate to.
Parameters:
  key - the key to use when delegating.
public static  KeyedPoolableObjectFactoryadapt(PoolableObjectFactory factory)
     Adapt a PoolableObjectFactory instance to work where a KeyedPoolableObjectFactory is needed.
public static  ObjectPooladapt(KeyedObjectPool keyedPool)
     Adapt a KeyedObjectPool instance to work where an ObjectPool is needed.
public static  ObjectPooladapt(KeyedObjectPool keyedPool, Object key)
     Adapt a KeyedObjectPool instance to work where an ObjectPool is needed using the specified key when delegating.
Parameters:
  keyedPool - the KeyedObjectPool to delegate to.
Parameters:
  key - the key to use when delegating.
public static  KeyedObjectPooladapt(ObjectPool pool)
     Adapt an ObjectPool to work where an KeyedObjectPool is needed. The key is ignored.
Parameters:
  pool - the ObjectPool to delegate to.
public static  TimerTaskcheckMinIdle(ObjectPool pool, int minIdle, long period)
     Periodically check the idle object count for the keyedPool.
public static  TimerTaskcheckMinIdle(KeyedObjectPool keyedPool, Object key, int minIdle, long period)
     Periodically check the idle object count for the key in the keyedPool.
public static  MapcheckMinIdle(KeyedObjectPool keyedPool, Collection keys, int minIdle, long period)
     Periodically check the idle object count for each key in the Collection keys in the keyedPool. At most one idle object will be added per period.
Parameters:
  keyedPool - the keyedPool to check periodically.
Parameters:
  keys - a collection of keys to check the idle object count.
Parameters:
  minIdle - if the KeyedObjectPool.getNumIdle(Object) is less than this then add an idle object.
Parameters:
  period - the frequency to check the number of idle objects in a keyedPool, seeTimer.schedule(TimerTasklonglong).
public static  ObjectPoolcheckedPool(ObjectPool pool, Class type)
     Wraps an ObjectPool and dynamically checks the type of objects borrowed and returned to the keyedPool.
public static  KeyedObjectPoolcheckedPool(KeyedObjectPool keyedPool, Class type)
     Wraps an KeyedObjectPool and dynamically checks the type of objects borrowed and returned to the keyedPool.
public static  voidprefill(ObjectPool pool, int count)
     Call addObject() on keyedPool count number of times.
public static  voidprefill(KeyedObjectPool keyedPool, Object key, int count)
     Call addObject(Object) on keyedPool with key count number of times.
public static  voidprefill(KeyedObjectPool keyedPool, Collection keys, int count)
     Call addObject(Object) on keyedPool with each key in keys for count number of times.
public static  ObjectPoolsynchronizedPool(ObjectPool pool)
     Returns a synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.
Parameters:
  pool - the ObjectPool to be "wrapped" in a synchronized ObjectPool.
public static  KeyedObjectPoolsynchronizedPool(KeyedObjectPool keyedPool)
     Returns a synchronized (thread-safe) KeyedObjectPool backed by the specified KeyedObjectPool.
Parameters:
  keyedPool - the KeyedObjectPool to be "wrapped" in a synchronized KeyedObjectPool.
public static  PoolableObjectFactorysynchronizedPoolableFactory(PoolableObjectFactory factory)
     Returns a synchronized (thread-safe) PoolableObjectFactory backed by the specified PoolableObjectFactory.
Parameters:
  factory - the PoolableObjectFactory to be "wrapped" in a synchronized PoolableObjectFactory.
public static  KeyedPoolableObjectFactorysynchronizedPoolableFactory(KeyedPoolableObjectFactory keyedFactory)
     Returns a synchronized (thread-safe) KeyedPoolableObjectFactory backed by the specified KeyedPoolableObjectFactory.
Parameters:
  keyedFactory - the KeyedPoolableObjectFactory to be "wrapped" in a synchronized KeyedPoolableObjectFactory.


Constructor Detail
PoolUtils
public PoolUtils()(Code)
PoolUtils instances should NOT be constructed in standard programming. Instead, the class should be used procedurally: PoolUtils.adapt(aPool);. This constructor is public to permit tools that require a JavaBean instance to operate.




Method Detail
adapt
public static PoolableObjectFactory adapt(KeyedPoolableObjectFactory keyedFactory) throws IllegalArgumentException(Code)
Adapt a KeyedPoolableObjectFactory instance to work where a PoolableObjectFactory is needed. This method is the equivalent of calling PoolUtils.adapt(KeyedPoolableObjectFactory,Object) PoolUtils.adapt(aKeyedPoolableObjectFactory, new Object()) .
Parameters:
  keyedFactory - the KeyedPoolableObjectFactory to delegate to. a PoolableObjectFactory that delegates to keyedFactory with an internal key.
throws:
  IllegalArgumentException - when keyedFactory is null.
See Also:   PoolUtils.adapt(KeyedPoolableObjectFactory,Object)
since:
   Pool 1.3



adapt
public static PoolableObjectFactory adapt(KeyedPoolableObjectFactory keyedFactory, Object key) throws IllegalArgumentException(Code)
Adapt a KeyedPoolableObjectFactory instance to work where a PoolableObjectFactory is needed using the specified key when delegating.
Parameters:
  keyedFactory - the KeyedPoolableObjectFactory to delegate to.
Parameters:
  key - the key to use when delegating. a PoolableObjectFactory that delegates to keyedFactory with the specified key.
throws:
  IllegalArgumentException - when keyedFactory or key is null.
See Also:   PoolUtils.adapt(KeyedPoolableObjectFactory)
since:
   Pool 1.3



adapt
public static KeyedPoolableObjectFactory adapt(PoolableObjectFactory factory) throws IllegalArgumentException(Code)
Adapt a PoolableObjectFactory instance to work where a KeyedPoolableObjectFactory is needed. The key is ignored.
Parameters:
  factory - the PoolableObjectFactory to delegate to. a KeyedPoolableObjectFactory that delegates to factory ignoring the key.
throws:
  IllegalArgumentException - when factory is null.
since:
   Pool 1.3



adapt
public static ObjectPool adapt(KeyedObjectPool keyedPool) throws IllegalArgumentException(Code)
Adapt a KeyedObjectPool instance to work where an ObjectPool is needed. This is the equivalent of calling PoolUtils.adapt(KeyedObjectPool,Object) PoolUtils.adapt(aKeyedObjectPool, new Object()) .
Parameters:
  keyedPool - the KeyedObjectPool to delegate to. an ObjectPool that delegates to keyedPool with an internal key.
throws:
  IllegalArgumentException - when keyedPool is null.
See Also:   PoolUtils.adapt(KeyedObjectPool,Object)
since:
   Pool 1.3



adapt
public static ObjectPool adapt(KeyedObjectPool keyedPool, Object key) throws IllegalArgumentException(Code)
Adapt a KeyedObjectPool instance to work where an ObjectPool is needed using the specified key when delegating.
Parameters:
  keyedPool - the KeyedObjectPool to delegate to.
Parameters:
  key - the key to use when delegating. an ObjectPool that delegates to keyedPool with the specified key.
throws:
  IllegalArgumentException - when keyedPool or key is null.
See Also:   PoolUtils.adapt(KeyedObjectPool)
since:
   Pool 1.3



adapt
public static KeyedObjectPool adapt(ObjectPool pool) throws IllegalArgumentException(Code)
Adapt an ObjectPool to work where an KeyedObjectPool is needed. The key is ignored.
Parameters:
  pool - the ObjectPool to delegate to. a KeyedObjectPool that delegates to keyedPool ignoring the key.
throws:
  IllegalArgumentException - when keyedPool is null.
since:
   Pool 1.3



checkMinIdle
public static TimerTask checkMinIdle(ObjectPool pool, int minIdle, long period) throws IllegalArgumentException(Code)
Periodically check the idle object count for the keyedPool. At most one idle object will be added per period. If there is an exception when calling ObjectPool.addObject then no more checks will be performed.
Parameters:
  pool - the keyedPool to check periodically.
Parameters:
  minIdle - if the ObjectPool.getNumIdle is less than this then add an idle object.
Parameters:
  period - the frequency to check the number of idle objects in a keyedPool, seeTimer.schedule(TimerTasklonglong). the TimerTask that will periodically check the pools idle object count.
throws:
  IllegalArgumentException - when keyedPool is null orwhen minIdle is negative or when period isn'tvalid for Timer.schedule(TimerTasklonglong).
since:
   Pool 1.3



checkMinIdle
public static TimerTask checkMinIdle(KeyedObjectPool keyedPool, Object key, int minIdle, long period) throws IllegalArgumentException(Code)
Periodically check the idle object count for the key in the keyedPool. At most one idle object will be added per period. If there is an exception when calling KeyedObjectPool.addObject(Object) then no more checks for that key will be performed.
Parameters:
  keyedPool - the keyedPool to check periodically.
Parameters:
  key - the key to check the idle count of.
Parameters:
  minIdle - if the KeyedObjectPool.getNumIdle(Object) is less than this then add an idle object.
Parameters:
  period - the frequency to check the number of idle objects in a keyedPool, seeTimer.schedule(TimerTasklonglong). the TimerTask that will periodically check the pools idle object count.
throws:
  IllegalArgumentException - when keyedPool, key is null orwhen minIdle is negative or when period isn'tvalid for Timer.schedule(TimerTasklonglong).
since:
   Pool 1.3



checkMinIdle
public static Map checkMinIdle(KeyedObjectPool keyedPool, Collection keys, int minIdle, long period) throws IllegalArgumentException(Code)
Periodically check the idle object count for each key in the Collection keys in the keyedPool. At most one idle object will be added per period.
Parameters:
  keyedPool - the keyedPool to check periodically.
Parameters:
  keys - a collection of keys to check the idle object count.
Parameters:
  minIdle - if the KeyedObjectPool.getNumIdle(Object) is less than this then add an idle object.
Parameters:
  period - the frequency to check the number of idle objects in a keyedPool, seeTimer.schedule(TimerTasklonglong). a Map of key and TimerTask pairs that will periodically check the pools idle object count.
throws:
  IllegalArgumentException - when keyedPool, keys, or any of the values in thecollection is null or when minIdle is negative or when period isn'tvalid for Timer.schedule(TimerTasklonglong).
See Also:   PoolUtils.checkMinIdle(KeyedObjectPool,Object,int,long)
since:
   Pool 1.3



checkedPool
public static ObjectPool checkedPool(ObjectPool pool, Class type)(Code)
Wraps an ObjectPool and dynamically checks the type of objects borrowed and returned to the keyedPool. If an object is passed to the keyedPool that isn't of type type a ClassCastException will be thrown.
Parameters:
  pool - the keyedPool to enforce type safety on an ObjectPool that will only allow objects of type
since:
   Pool 1.3



checkedPool
public static KeyedObjectPool checkedPool(KeyedObjectPool keyedPool, Class type)(Code)
Wraps an KeyedObjectPool and dynamically checks the type of objects borrowed and returned to the keyedPool. If an object is passed to the keyedPool that isn't of type type a ClassCastException will be thrown.
Parameters:
  keyedPool - the keyedPool to enforce type safety on an KeyedObjectPool that will only allow objects of type
since:
   Pool 1.3



prefill
public static void prefill(ObjectPool pool, int count) throws Exception, IllegalArgumentException(Code)
Call addObject() on keyedPool count number of times.
Parameters:
  pool - the keyedPool to prefill.
Parameters:
  count - the number of idle objects to add.
throws:
  Exception - when ObjectPool.addObject fails.
throws:
  IllegalArgumentException - when keyedPool is null.
since:
   Pool 1.3



prefill
public static void prefill(KeyedObjectPool keyedPool, Object key, int count) throws Exception, IllegalArgumentException(Code)
Call addObject(Object) on keyedPool with key count number of times.
Parameters:
  keyedPool - the keyedPool to prefill.
Parameters:
  key - the key to add objects for.
Parameters:
  count - the number of idle objects to add for key.
throws:
  Exception - when KeyedObjectPool.addObject(Object) fails.
throws:
  IllegalArgumentException - when keyedPool or key is null.
since:
   Pool 1.3



prefill
public static void prefill(KeyedObjectPool keyedPool, Collection keys, int count) throws Exception, IllegalArgumentException(Code)
Call addObject(Object) on keyedPool with each key in keys for count number of times. This has the same effect as calling PoolUtils.prefill(KeyedObjectPool,Object,int) for each key in the keys collection.
Parameters:
  keyedPool - the keyedPool to prefill.
Parameters:
  keys - Collection of keys to add objects for.
Parameters:
  count - the number of idle objects to add for each key.
throws:
  Exception - when KeyedObjectPool.addObject(Object) fails.
throws:
  IllegalArgumentException - when keyedPool, keys, orany value in keys is null.
See Also:   PoolUtils.prefill(KeyedObjectPool,Object,int)
since:
   Pool 1.3



synchronizedPool
public static ObjectPool synchronizedPool(ObjectPool pool)(Code)
Returns a synchronized (thread-safe) ObjectPool backed by the specified ObjectPool.
Parameters:
  pool - the ObjectPool to be "wrapped" in a synchronized ObjectPool. a synchronized view of the specified ObjectPool.
since:
   Pool 1.3



synchronizedPool
public static KeyedObjectPool synchronizedPool(KeyedObjectPool keyedPool)(Code)
Returns a synchronized (thread-safe) KeyedObjectPool backed by the specified KeyedObjectPool.
Parameters:
  keyedPool - the KeyedObjectPool to be "wrapped" in a synchronized KeyedObjectPool. a synchronized view of the specified KeyedObjectPool.
since:
   Pool 1.3



synchronizedPoolableFactory
public static PoolableObjectFactory synchronizedPoolableFactory(PoolableObjectFactory factory)(Code)
Returns a synchronized (thread-safe) PoolableObjectFactory backed by the specified PoolableObjectFactory.
Parameters:
  factory - the PoolableObjectFactory to be "wrapped" in a synchronized PoolableObjectFactory. a synchronized view of the specified PoolableObjectFactory.
since:
   Pool 1.3



synchronizedPoolableFactory
public static KeyedPoolableObjectFactory synchronizedPoolableFactory(KeyedPoolableObjectFactory keyedFactory)(Code)
Returns a synchronized (thread-safe) KeyedPoolableObjectFactory backed by the specified KeyedPoolableObjectFactory.
Parameters:
  keyedFactory - the KeyedPoolableObjectFactory to be "wrapped" in a synchronized KeyedPoolableObjectFactory. a synchronized view of the specified KeyedPoolableObjectFactory.
since:
   Pool 1.3



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.