A small utility class for instantiation of and disposing of instances
that need to be created using dependencies from a resolver, but that
should not live inside the container. Example usage:
Resolver resolver =
DefaultBuilder.newInstance()
.addComponent( HomerImpl.class )
.addComponent( MargeImpl.class )
.create();
Script unmangedScript = (Script)FactoryUtil.newInstance( resolver,
SomeScriptImpl.class );
// ...
FactoryUtil.releaseInstance( unmanagedScript );
author: Leo Simons version: $Id: FactoryUtil.java,v 1.2 2004/03/23 13:37:52 lsimons Exp $ |