org.apache.lucene.gdata.utils
Interface PoolObjectFactory<Type>

Type Parameters:
Type - - the type to be created

public interface PoolObjectFactory<Type>

This interface enables Pool users to build a custom creation and destroy mechanismn for pooled objects. Implementations can use standart creation to prevent the pool from using reflection to create objects of the specific type. This implementation seperates the Pool implementation from the creation or the destruction of a pooled type.

The destroy method can be used to close datasource connections or release resources if the object will be removed from the pool

Author:
Simon Willnauer
See Also:
Pool

Method Summary
 void destroyInstance(Type type)
          destroys the given instance
 Type getInstance()
           
 

Method Detail

getInstance

Type getInstance()
Returns:
an instance of the specified Type

destroyInstance

void destroyInstance(Type type)
destroys the given instance

Parameters:
type - - the object to destroy / release all resources


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.