[pool] Factory example

2013-11-29 Thread Manuel Irribarra

  
  
Hi,

 Following the example page, I noted that Factory example for
PooleableObjectFactory is wrong. When you extends
BasePooledObjectFactory?, there only 2 methods required:

+ public ? create()
+ public PooledObject? wrap (? object)

 I guess that create method must created a new object instance,
but... how I must use the wrap method?

 Any one have an example?

-- 
  

  
  Manuel A.
  Irribarra Frex
Ingeniero de
  Desarrollo
Altiuz Soluciones Tecnolgicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
+56 2 2335 2461
  
  

  
  mirriba...@altiuz.cl
http://www.altiuz.cl
http://www.altiuzreports.com
   
 
  
  

  

  

  
  

  

  



Re: [pool] Factory example

2013-11-29 Thread Phil Steitz
On 11/29/13, 7:28 AM, Manuel Irribarra wrote:
 Hi,

 Following the example page, I noted that Factory example for
 PooleableObjectFactory is wrong. When you extends
 BasePooledObjectFactory?, there only 2 methods required:

 + public ? create()
 + public PooledObject? wrap (? object)

 I guess that create method must created a new object instance,
 but... ¿how I must use the wrap method?

 Any one have an example?

Yes, create() creates a new object instances.

wrap creates a PooledObject from a newly-created instance.  There is
a DefaultPooledObject implementation provided.  To use that, just use

@Override
 public PooledObjectFoo wrap(Foo foo) {
return new DefaultPooledObjectFoo(foo);
 }
 
Thanks for pointing out the problem with the example page.  It needs to be 
updated to reflect the new API.  It is still using the old 
PoolableObjectFactory, which no longer exists.  I will replace this with a 
working 2.0 example shortly.

Phil



 -- 
 *Manuel A. Irribarra Frex*
 *Ingeniero de Desarrollo*
 Altiuz Soluciones Tecnológicas de Negocios Ltda.
 Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
 +56 2 2335 2461
 mirriba...@altiuz.cl mailto:mirriba...@altiuz.cl
 http://www.altiuz.cl
 http://www.altiuzreports.com  https://www.facebook.com/altiuz
 http://twitter.com/altiuz http://www.linkedin.com/company/altiuz

   



-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [pool] Factory example

2013-11-29 Thread Manuel Irribarra

  
  
Thanks Phil, this work great.

On 29/11/13 13:25, Phil Steitz wrote:


  new DefaultPooledObjectFoo(foo);


-- 
  

  
  Manuel A.
  Irribarra Frex
Ingeniero de
  Desarrollo
Altiuz Soluciones Tecnolgicas de Negocios Ltda.
Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
+56 2 2335 2461
  
  

  
  mirriba...@altiuz.cl
http://www.altiuz.cl
http://www.altiuzreports.com