info.magnolia.objectfactory
Interface ComponentFactory<T>

Type Parameters:
T - the type of component this factory instantiates.
All Known Subinterfaces:
FactoryUtil.InstanceFactory
All Known Implementing Classes:
ConfiguredComponentFactory, FactoryUtil.ObservedObjectFactory, IPSecurityManagerImpl.InstanceFactory, LazyObservedComponentFactory, ObservedComponentFactory, ServerConfiguration.InstanceFactory

public interface ComponentFactory<T>

Implementations of ComponentFactory provide their own instantiation mechanisms. Implementations could for instance get constructor parameters from some well-known place, or call an initialization method, etc. ComponentFactory implementations can be registered in place of the component they're instantiating. (i.e using the same key)

Version:
$Id$
See Also:
ComponentProvider.getComponent(Class)

Method Summary
 T newInstance()
          Called by the ComponentProvider to create a component.
 

Method Detail

newInstance

T newInstance()
Called by the ComponentProvider to create a component. This will only be done once and hence instances created by component factories are effectively singletons.



Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.