public interface LookupTypeFactory
LookupTypeFactory
defines the functionality which must be
provided in order to represent a factory for object creation of *ALL* objects
being of a requested type (in contrast to the TypedFactory
and the
TypedLookupIdFactory
which create instances of a predefined type
specified with a generic argument). Many alternative implementations of a
LookupTypeFactory
may may exist which construct the instances their
way.
Having factories that generic as we define it here, we are able to decouple
our business logic from any specific framework: Your business logic must not
know anything about how the instance are generated. It mainly just needs to
know how to use the LookupTypeFactory
. It is up to the application
"end point", i.e. a command line tool with a main-method or a web-application
to finally decide which factory to use.
Depending on the implementation used or configuration provided, the
LookupTypeFactory
may return singletons or dedicated separate
instances when queried for instances.
Modifier and Type | Method and Description |
---|---|
<T> Set<T> |
createInstances(Class<?> aType)
This method creates / retrieves an all instances of the given type.
|
<T> Set<T> |
createInstances(Class<?> aType,
Properties aProperties)
This method creates / retrieves all instances of the given type.
|
<T> Set<T> createInstances(Class<?> aType)
T
- The type which is to be fabricated by the factory method.aType
- The type identifying the instances to be created /
retrieved.ClassCastException
- in case the fabricated type is not type
compatible with the required type T.<T> Set<T> createInstances(Class<?> aType, Properties aProperties)
T
- The type which is to be fabricated by the factory method.aType
- The type identifying the instances to be created /
retrieved.aProperties
- The dynamic properties which are used to configure the
desired bean.ClassCastException
- in case the fabricated type is not type
compatible with the required type T.Copyright © 2015. All rights reserved.