|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fulmine.model.container.ContainerFactory
public final class ContainerFactory
A factory that creates IContainer
implementations. An
IContainerFactory.IContainerBuilder
is registered for each container
type (see IContainer.getType()
). The registered builder creates each
instance. The builder is registered using the
#registerBuilder(IType, fulmine.model.container.ContainerFactory.IContainerBuilder)
method. By default, if there is no builder registered for a container type, a
Record
is created.
The factory is thread safe.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface fulmine.model.container.IContainerFactory |
---|
IContainerFactory.IContainerBuilder |
Constructor Summary | |
---|---|
ContainerFactory()
Standard constructor |
Method Summary | ||
---|---|---|
boolean |
containsType(IType type)
Does the factory contain an IContainerFactory.IContainerBuilder
(and by association, an IContainerDefinitionField ) registered
against the IContainer type argument. |
|
|
createContainer(String nativeContextIdentity,
String identity,
IType type,
IDomain domain,
IFrameworkContext hostContext,
boolean local)
Create an IContainer implementation from the type argument. |
|
void |
destroy()
This is called when the object is being removed from application use. |
|
IContainerDefinitionField |
getDefinition(IType type)
Get the IContainerDefinitionField registered against the
IContainer type argument. |
|
void |
registerBuilder(IType type,
IContainerFactory.IContainerBuilder builder)
Register an IContainerFactory.IContainerBuilder against the
IContainer type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContainerFactory()
Method Detail |
---|
public void registerBuilder(IType type, IContainerFactory.IContainerBuilder builder)
IContainerFactory.IContainerBuilder
against the
IContainer
type. This will overwrite any existing builder
registered against the type.
registerBuilder
in interface IContainerFactory
type
- the type of the IContainer
the builder createsbuilder
- the container builder to register
IllegalArgumentException
- if the type IType.value()
is less than
Type.BASE_USER_START
containsType(IType)
,
IContainer.getType()
public boolean containsType(IType type)
IContainerFactory.IContainerBuilder
(and by association, an IContainerDefinitionField
) registered
against the IContainer
type argument.
containsType
in interface IContainerFactory
type
- the type of the IContainer
the builder creates
true
if there is a
IContainerFactory.IContainerBuilder
registered against
the typeIContainer.getType()
public IContainerDefinitionField getDefinition(IType type)
IContainerDefinitionField
registered against the
IContainer
type argument. This should not be called for dynamic
container types.
getDefinition
in interface IContainerFactory
type
- the type of the IContainer
the definition applies to
IContainerDefinitionField
for the type of the
IContainer
IllegalArgumentException
- if the IContainer
is a dynamic type (there will be no
IContainerDefinitionField
found)containsType(IType)
,
IContainer.getType()
public <T extends IContainer> T createContainer(String nativeContextIdentity, String identity, IType type, IDomain domain, IFrameworkContext hostContext, boolean local)
IContainer
implementation from the type argument. If
there is no application IContainerFactory.IContainerBuilder
registered for the type, a default builder is used that creates an
Record
.
createContainer
in interface IContainerFactory
identity
- the identity for the container to createtype
- the type of the IContainer
implementation to createhostContext
- the context the container will be associated withnativeContextIdentity
- the name of the context this container is native to - the name
of its local contextdomain
- the domain for the container implementationlocal
- true
the container is local to this context
IContainer
implementationcontainsType(IType)
,
IContainer.getType()
public void destroy()
IDestroyable
This method must not throw a RuntimeException
.
destroy
in interface IDestroyable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |