fulmine.model.container
Interface IContainerFactory

All Superinterfaces:
IDestroyable
All Known Implementing Classes:
ContainerFactory

public interface IContainerFactory
extends IDestroyable

Factory held by an IFrameworkContext to create IContainer instances

Author:
Ramon Servadei

Nested Class Summary
static interface IContainerFactory.IContainerBuilder
          A builder for an IContainer.
 
Method Summary
 boolean containsType(IType type)
          Does the factory contain an IContainerFactory.IContainerBuilder (and by association, an IContainerDefinitionField) registered against the IContainer type argument.
<T extends IContainer>
T
createContainer(String nativeContextIdentity, String identity, IType type, IDomain domain, IFrameworkContext hostContext, boolean local)
          Create an IContainer implementation from the type argument.
 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 interface fulmine.IDestroyable
destroy
 

Method Detail

registerBuilder

void registerBuilder(IType type,
                     IContainerFactory.IContainerBuilder builder)
Register an IContainerFactory.IContainerBuilder against the IContainer type. This will overwrite any existing builder registered against the type.

Parameters:
type - the type of the IContainer the builder creates
builder - the container builder to register
Throws:
IllegalArgumentException - if the type code ( IType.value() ) is less than Type.BASE_USER_START
See Also:
containsType(IType), IContainer.getType()

containsType

boolean containsType(IType type)
Does the factory contain an IContainerFactory.IContainerBuilder (and by association, an IContainerDefinitionField) registered against the IContainer type argument.

Parameters:
type - the type of the IContainer the builder creates
Returns:
true if there is a IContainerFactory.IContainerBuilder registered against the type
See Also:
IContainer.getType()

getDefinition

IContainerDefinitionField getDefinition(IType type)
Get the IContainerDefinitionField registered against the IContainer type argument. This should not be called for dynamic container types.

Parameters:
type - the type of the IContainer the definition applies to
Returns:
the IContainerDefinitionField for the type of the IContainer
Throws:
IllegalArgumentException - if the IContainer is a dynamic type (there will be no IContainerDefinitionField found)
See Also:
containsType(IType), IContainer.getType()

createContainer

<T extends IContainer> T createContainer(String nativeContextIdentity,
                                         String identity,
                                         IType type,
                                         IDomain domain,
                                         IFrameworkContext hostContext,
                                         boolean local)
Create an 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.

Parameters:
nativeContextIdentity - the name of the context this container is native to - the name of its local context
identity - the identity for the container to create
type - the type of the IContainer implementation to create
domain - the domain for the container implementation
hostContext - the context hosting this container instance
local - true the container is local to this context
Returns:
an IContainer implementation
See Also:
containsType(IType), IContainer.getType()


Copyright © 2007-2009. All Rights Reserved.