org.apache.avalon.composition.model
Interface ContainmentModel

All Superinterfaces:
Commissionable, DeploymentModel, Resolver
All Known Implementing Classes:
DefaultContainmentModel

public interface ContainmentModel
extends DeploymentModel

Containment model is an extended deployment model that aggregates a set of models. A containment model describes a logical containment context.

Version:
$Revision: 1.23 $ $Date: 2004/03/17 10:30:08 $
Author:
Avalon Development Team

Field Summary
static String KEY
           
static String SECURE_EXECUTION_KEY
           
 
Fields inherited from interface org.apache.avalon.composition.model.DeploymentModel
DEPLOYMENT_TIMEOUT_KEY, SEPARATOR
 
Method Summary
 void addCompositionListener(CompositionListener listener)
          Add a composition listener to the model.
 ContainmentModel addContainmentModel(URL url)
          Addition of a new subsidiary containment model using a supplied profile url.
 ContainmentModel addContainmentModel(URL block, URL config)
          Addition of a new subsidiary containment model within the containment context using a supplied url.
 DeploymentModel addModel(DeploymentModel model)
          Addition of a new subsidiary model within the containment context.
 DeploymentModel addModel(DeploymentProfile profile)
          Addition of a new subsidiary model within the containment context using a supplied profile.
 void applyTargets(TargetDirective[] targets)
          Apply a set of override targets.
 void applyTargets(URL url)
          Apply a set of override targets resolvable from a supplied url.
 void assemble()
          Assemble the containment model.
 void assemble(List subjects)
          Assemble the model.
 void disassemble()
          Disassemble the model.
 ClassLoaderModel getClassLoaderModel()
          Return the classloader model.
 long getDeploymentTimeout()
          Return the default deployment timeout value declared in the kernel configuration.
 DeploymentModel getModel(DependencyDescriptor dependency)
          Resolve a model capable of supporting the supplied service reference.
 DeploymentModel getModel(ReferenceDescriptor descriptor)
          Resolve a model capable of supporting the supplied service reference.
 DeploymentModel getModel(String path)
          Return a model relative to a supplied path.
 DeploymentModel[] getModels()
          Return the set of models nested within this model.
 String getPartition()
          Return the partition established by the containment model.
 ServiceModel getServiceModel(Class clazz)
          Return a service exoport model matching a supplied class.
 ServiceModel[] getServiceModels()
          Return the set of service export models.
 DeploymentModel[] getShutdownGraph()
          Get the shutdown sequence for the model.
 DeploymentModel[] getStartupGraph()
          Get the startup sequence for the model.
 void removeCompositionListener(CompositionListener listener)
          Remove a composition listener from the model.
 void removeModel(String name)
          Remove a named model from this model.
 
Methods inherited from interface org.apache.avalon.composition.model.DeploymentModel
getAccessControlContext, getCategories, getConsumerGraph, getLogger, getMode, getName, getPath, getProviderGraph, getProviders, getQualifiedName, getServices, isaCandidate, isaCandidate, isaCandidate, isAssembled, setCategories
 
Methods inherited from interface org.apache.avalon.composition.model.Commissionable
commission, decommission
 
Methods inherited from interface org.apache.avalon.composition.model.Resolver
release, resolve, resolve
 

Field Detail

KEY

public static final String KEY
See Also:
Constant Field Values

SECURE_EXECUTION_KEY

public static final String SECURE_EXECUTION_KEY
See Also:
Constant Field Values
Method Detail

getStartupGraph

public DeploymentModel[] getStartupGraph()
Get the startup sequence for the model.


getShutdownGraph

public DeploymentModel[] getShutdownGraph()
Get the shutdown sequence for the model.


getPartition

public String getPartition()
Return the partition established by the containment model.

Returns:
the partition name

getClassLoaderModel

public ClassLoaderModel getClassLoaderModel()
Return the classloader model.

Returns:
the classloader model

getDeploymentTimeout

public long getDeploymentTimeout()
Return the default deployment timeout value declared in the kernel configuration. The implementation looks for a value assigned under the property key "urn:composition:deployment.timeout" and defaults to 1000 msec if undefined.

Specified by:
getDeploymentTimeout in interface DeploymentModel
Returns:
the default deployment timeout value

assemble

public void assemble()
              throws AssemblyException
Assemble the containment model.

Throws:
Exception - if an error occurs during model assembly
AssemblyException

assemble

public void assemble(List subjects)
              throws AssemblyException
Assemble the model.

Parameters:
subjects - a list of deployment models that make up the assembly chain
Throws:
Exception - if an error occurs during model assembly
AssemblyException

disassemble

public void disassemble()
Disassemble the model.


getModels

public DeploymentModel[] getModels()
Return the set of models nested within this model.

Returns:
the classloader model

getModel

public DeploymentModel getModel(String path)
Return a model relative to a supplied path.

Parameters:
path - a relative or absolute path
Returns:
the model or null if the path is unresolvable
Throws:
IllegalArgumentException - if the path if badly formed

getModel

public DeploymentModel getModel(ReferenceDescriptor descriptor)
                         throws AssemblyException
Resolve a model capable of supporting the supplied service reference.

Parameters:
descriptor - a service reference descriptor
Returns:
the model or null if unresolvable
Throws:
AssemblyException - if an assembly error occurs

getModel

public DeploymentModel getModel(DependencyDescriptor dependency)
                         throws AssemblyException
Resolve a model capable of supporting the supplied service reference.

Parameters:
dependency - a service dependency descriptor
Returns:
the model or null if unresolvable
Throws:
AssemblyException - if an assembly error occurs

addContainmentModel

public ContainmentModel addContainmentModel(URL url)
                                     throws ModelException
Addition of a new subsidiary containment model using a supplied profile url.

Parameters:
url - a containment profile url
Returns:
the model based on the derived profile
Throws:
ModelException - if an error occurs during model establishment

addContainmentModel

public ContainmentModel addContainmentModel(URL block,
                                            URL config)
                                     throws ModelException
Addition of a new subsidiary containment model within the containment context using a supplied url.

Parameters:
block - a url referencing a containment profile
config - containment configuration targets
Returns:
the model created using the derived profile and configuration
Throws:
ModelException - if an error occurs during model establishment

addModel

public DeploymentModel addModel(DeploymentProfile profile)
                         throws ModelException
Addition of a new subsidiary model within the containment context using a supplied profile.

Parameters:
profile - a containment or deployment profile
Returns:
the model based on the supplied profile
Throws:
ModelException - if an error occurs during model establishment

addModel

public DeploymentModel addModel(DeploymentModel model)
Addition of a new subsidiary model within the containment context.

Parameters:
model - the model to add
Returns:
the model

removeModel

public void removeModel(String name)
Remove a named model from this model.

Parameters:
name - the name of an immediate child model

getServiceModels

public ServiceModel[] getServiceModels()
Return the set of service export models.

Returns:
t he export directives

getServiceModel

public ServiceModel getServiceModel(Class clazz)
Return a service exoport model matching a supplied class.

Returns:
the service model

applyTargets

public void applyTargets(URL url)
                  throws ModelException
Apply a set of override targets resolvable from a supplied url.

Parameters:
url - a url resolvable to a TargetDirective[]
Throws:
ModelException - if an error occurs

applyTargets

public void applyTargets(TargetDirective[] targets)
Apply a set of override targets.

Parameters:
targets - a set of target directives

addCompositionListener

public void addCompositionListener(CompositionListener listener)
Add a composition listener to the model.

Parameters:
listener - the composition listener

removeCompositionListener

public void removeCompositionListener(CompositionListener listener)
Remove a composition listener from the model.

Parameters:
listener - the composition listener


Copyright © The Apache Software Foundation. All Rights Reserved.