IObjectPool Interface

From RemObjects Software

Jump to: navigation, search

This is a Data Abstract Architecture entry
Feel free to add your notes to this topic below.



Overview

Namespace

Declaration (C#)

public interface IObjectPool<TItem>;

Hierarchy

  • IObjectPool

Properties

Property
Type
Description
AcquiredInstancesCount Integer Contains the number of acquired items from the object pool.
Behavior PoolBehavior Specifies the behavior of the object pool when an item is going to be acquired but the pool is full (the elements in the pool are equal to MaxPoolSize).
MaxPoolSize Integer The maximum number of items to be contained in the pool of this object pool, or -1 for unlimited.
NonAcquiredInstancesCount Integer Contains the number of instances in the pool that have not been acquired.
PoolSize Integer Returns the size of the pool, including already acquired instances (NonAcquiredInstancesCount + AcquiredInstancesCount).
WaitTimeOut Integer Time that the object pool will wait to acquire a new instance before throwing a timeout exception when the Behavior is set to PoolBehavior.Wait.

When the value is -1 the pool will wait indefinitely.


Methods

Method
Description
AcquireInstance Acquires an item from the pool.

If no items are available from the pool, Behavior property specifies whether the pool will wait for an item to become available, throw an exception or create a new, unpooled instance.

Clear Clears all items from the pool.

This has the same effect as calling Resize(0, true).

ReleaseInstance Releases an acquired item back into the pool.

When the pool is using the Waiting behavior, the first thread waiting will return after releasing an item to a full pool.

Resize Resizes the pool.

If second parameter is true it will set the maximum size to first parameters's value. If second parameter is false and there are more acquired in the list than given in first parameters's value, this method will throw an exception.


See Also


Product: RemObjects Data Abstract
Current version: Data Abstract 'Vinci' (5.0)

ListsGlossaryFeaturesHow ToDriversComponentsToolsSamplesArticlesArchitectureIssues

Personal tools