TorqueBox 3.1.2

org.torquebox.core.pool
Interface Pool<T>

Type Parameters:
T - The instance type.
All Known Subinterfaces:
ManageablePool<T>
All Known Implementing Classes:
DefaultRubyRuntimePool, ManagedPool, SharedPool, SharedRubyRuntimePool, SimplePool

public interface Pool<T>

A simple instance pool.

Author:
Bob McWhirter

Method Summary
 T borrowInstance(String requester)
          Borrow an instance from the pool.
 T borrowInstance(String requester, long timeout)
          Borrow an instance from the pool.
 String getName()
           
 void releaseInstance(T instance)
          Release an instance back into the pool.
 

Method Detail

borrowInstance

T borrowInstance(String requester)
                 throws Exception
Borrow an instance from the pool.

Returns:
The borrowed instance.
Throws:
Exception - if an error occurs.

borrowInstance

T borrowInstance(String requester,
                 long timeout)
                 throws Exception
Borrow an instance from the pool.

Parameters:
timeout - Wait time to acquire instance.
Returns:
The borrowed instance.
Throws:
Exception - if an error occurs.

releaseInstance

void releaseInstance(T instance)
Release an instance back into the pool.

Parameters:
instance - The instance to release.

getName

String getName()

TorqueBox 3.1.2

Copyright © 2015 JBoss by Red Hat. All Rights Reserved.