org.szegedi.spring.support
Class SoftPooledFactory

java.lang.Object
  extended by org.szegedi.spring.support.SoftPooledFactory

public abstract class SoftPooledFactory
extends java.lang.Object

A factory of soft-reference pooled objects. While we are aware that pooling in general is harmful on modern VMs, we do actually have use cases - i.e. expensively initialized cryptographical transformators - that make sense to pool.

Version:
$Id: SoftPooledFactory.java 55 2007-02-19 13:15:32Z szegedia $
Author:
Attila Szegedi

Constructor Summary
SoftPooledFactory()
           
 
Method Summary
protected abstract  java.lang.Object create()
           
 java.lang.ref.Reference get()
           
 void put(java.lang.ref.Reference ref)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoftPooledFactory

public SoftPooledFactory()
Method Detail

get

public java.lang.ref.Reference get()
                            throws java.lang.Exception
Throws:
java.lang.Exception

put

public void put(java.lang.ref.Reference ref)

create

protected abstract java.lang.Object create()
                                    throws java.lang.Exception
Throws:
java.lang.Exception