Brooklyn

brooklyn.util.pool
[Java] Interface Pool


public interface Pool
extends java.io.Closeable

See discussion at http://code.google.com/p/guava-libraries/issues/detail?id=683. This API is inspired by that proposed by kevinb

google.com:
There are two ways to use the pool. Passive:
 Pool pool = ...
   Lease lease = pool.leaseObject();
   try {
     Expensive o = lease.leasedObject();
     doSomethingWith(o);
    finally {
     lease.close();
   }
 }
 
Or active:
 Pool pool = ...
   pool.exec(
       new Function() {
         public Void apply(Expensive o) {
           doSomethingWith(o);
           return null;
         
       });
 }
 
Authors:
aled
See Also:
BasicPool


Method Summary
void close()

R exec(Function receiver)

Lease leaseObject()

 
Methods inherited from interface java.io.Closeable
java.io.Closeable#close()
 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

close

public void close()


exec

public R exec(Function receiver)


leaseObject

public Lease leaseObject()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.