fulmine.model
Interface IModelManager

All Superinterfaces:
IDestroyable, ILifeCycle
All Known Subinterfaces:
IFrameworkContext, IFulmineContext
All Known Implementing Classes:
FTContext, FulmineContext

public interface IModelManager
extends ILifeCycle

Manages the data model structures in a context. The data structures are held in IContainer instances. These may be either local or remote instances.

Author:
Ramon Servadei
See Also:
IFrameworkContext

Method Summary
 void addContainer(IContainer container)
          Add a container to this context.
 boolean containsLocalContainer(String identityRegularExpression, IType type, IDomain domain)
          Identify if the local container exists in this context
 boolean containsRemoteContainer(String remoteContextIdentity, String containerIdentity, IType type, IDomain domain)
          Identify if the remote container exists in this context
 IContainerFactory getContainerFactory()
          Get the container factory for the context.
 IContainer getLocalContainer(String identity, IType type, IDomain domain)
          Get the identified local container.
 Collection<IContainer> getLocalContainers()
          Get a copy of the collection of local containers in this context.
 IContainer getRemoteContainer(String remoteContextIdentity, String containerIdentity, IType type, IDomain domain)
          Get the identified remote container.
 Collection<IContainer> getRemoteContainers(String remoteContextIdentity)
          Get a copy of the collection of remote containers in this context.
 boolean removeContainer(IContainer container)
          Remove a container from the context.
 
Methods inherited from interface fulmine.ILifeCycle
isActive, start
 
Methods inherited from interface fulmine.IDestroyable
destroy
 

Method Detail

getContainerFactory

IContainerFactory getContainerFactory()
Get the container factory for the context. This factory is bound to this context.

Returns:
the container factory for the context

getLocalContainers

Collection<IContainer> getLocalContainers()
Get a copy of the collection of local containers in this context.

Returns:
a copy of the collection of all the local containers in this context

getLocalContainer

IContainer getLocalContainer(String identity,
                             IType type,
                             IDomain domain)
Get the identified local container. This container is native to this context. If it does not exist, it is created using the ContainerFactory.

If the ContainerFactory does not have a IContainerFactory.IContainerBuilder registered for the type argument, a standard container is created.

This operation does not support any wildcards for the attributes (it does not have the same contract for the identity, type and domain as IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener) .

Parameters:
identity - the identity of the local container
type - the type of the local container
domain - the domain of the local container
Returns:
a IContainer native to this context and hosted in this context

containsLocalContainer

boolean containsLocalContainer(String identityRegularExpression,
                               IType type,
                               IDomain domain)
Identify if the local container exists in this context

Parameters:
type - the type of the container to find
domain - the domain of the container
identity - the identity of the local container to find
Returns:
true if the local container exists

getRemoteContainer

IContainer getRemoteContainer(String remoteContextIdentity,
                              String containerIdentity,
                              IType type,
                              IDomain domain)
Get the identified remote container. This container is not native to this context. If it does not exist, it is created using the ContainerFactory and its state is set to be IContainer#STALE until it receives an update.

This method just creates the 'proxy shell' for the remote events to be applied to. Use the IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener) method to start receiving events for the container.

This operation does not support any wildcards for the attributes (it does not have the same contract for the identity, type and domain as IDistributionManager.subscribe(String, String, IType, IDomain, IEventListener) .

Parameters:
remoteContextIdentity - the identity of the remote context where the remote container originates from - this is only required if the remote container will be created. Use containsRemoteContainer(String, String, IType, IDomain) to determine if the remote container exists.
identity - the identity of the remote container
type - the type of the remote container
domain - the domain of the remote container
Returns:
a IContainer native to the specified remote context and hosted in this context

containsRemoteContainer

boolean containsRemoteContainer(String remoteContextIdentity,
                                String containerIdentity,
                                IType type,
                                IDomain domain)
Identify if the remote container exists in this context

Parameters:
remoteContextIdentity - the identity of the remote context where the remote container originated from
type - the type of the container to find
domain - the domain of the container
identity - the identity of the remote container to find
Returns:
true if the remote container exists

getRemoteContainers

Collection<IContainer> getRemoteContainers(String remoteContextIdentity)
Get a copy of the collection of remote containers in this context.

Parameters:
remoteContextIdentity - the remote context identity that the remote containers originated from
Returns:
a copy of the collection of all the remote containers in this context

addContainer

void addContainer(IContainer container)
Add a container to this context.

Parameters:
container - the container to add to this context

removeContainer

boolean removeContainer(IContainer container)
Remove a container from the context. This does not destroy the container but may leave the container with no references to it and thus it may be garbage collected.

Parameters:
container - the container to remove
Returns:
true if the container was removed, false if the container was not found


Copyright © 2007-2009. All Rights Reserved.