org.apache.avalon.composition.model.impl
Class DefaultDeploymentModel

java.lang.Object
  extended byorg.apache.avalon.composition.model.impl.DefaultModel
      extended byorg.apache.avalon.composition.model.impl.DefaultDeploymentModel
All Implemented Interfaces:
DeploymentModel, Model

public class DefaultDeploymentModel
extends DefaultModel
implements DeploymentModel

Deployment model defintion.

Version:
$Revision: 1.9 $ $Date: 2003/12/14 14:09:59 $
Author:
Avalon Development Team

Constructor Summary
DefaultDeploymentModel(DeploymentContext context)
          Creation of a new deployment model.
 
Method Summary
 boolean getActivationPolicy()
          Return the activation policy for the model.
 CategoriesDirective getCategories()
          Return the logging categories.
 int getCollectionPolicy()
          Return the collection policy for the model.
 Configuration getConfiguration()
          Return the configuration to be applied to the component.
 ContextModel getContextModel()
          Return the context model for this deployment model.
 DependencyModel[] getDependencyModels()
          Return the dependency models for this component type.
 Class getDeploymentClass()
          Return the class for the deployable target.
 Class[] getInterfaces()
          Return the set of services produced by the model as a array of classes.
 Parameters getParameters()
          Return the parameters to be applied to the component.
 ServiceDescriptor[] getServices()
          Return the set of services produced by the model.
 StageModel[] getStageModels()
          Return the stage models for this component type.
 Type getType()
          Return the component type descriptor.
 boolean isaCandidate(DependencyDescriptor dependency)
          Return TRUE is this model is capable of supporting a supplied depedendency.
 boolean isaCandidate(StageDescriptor stage)
          Return TRUE is this model is capable of supporting a supplied stage dependency.
 boolean isConfigurable()
          Rest if the component type backing the model is configurable.
 boolean isContextDependent()
          Test if the component type backing the model requires the establishment of a runtime context.
 boolean isParameterizable()
          Rest if the component type backing the model is parameterizable.
 void revertActivationPolicy()
          Set the activation policy for the model to the default value.
 void setActivationPolicy(boolean policy)
          Set the activation policy for the model.
 void setCategories(CategoriesDirective categories)
          Set categories.
 void setCollectionPolicy(int policy)
          Set the collection policy for the model.
 void setConfiguration(Configuration config)
          Set the configuration to the supplied value.
 void setConfiguration(Configuration config, boolean policy)
          Set the configuration to the supplied value.
 void setParameters(Parameters parameters)
          Set the parameters to the supplied value.
 void setParameters(Parameters parameters, boolean policy)
          Set the parameters to the supplied value.
 String toString()
           
 
Methods inherited from class org.apache.avalon.composition.model.impl.DefaultModel
getLogger, getMode, getName, getPath, getQualifiedName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.composition.model.Model
getMode, getName, getPath, getQualifiedName
 

Constructor Detail

DefaultDeploymentModel

public DefaultDeploymentModel(DeploymentContext context)
                       throws ModelException
Creation of a new deployment model.

Parameters:
context - the deployment context
Method Detail

getServices

public ServiceDescriptor[] getServices()
Return the set of services produced by the model.

Specified by:
getServices in interface Model
Returns:
the service descriptors

isaCandidate

public boolean isaCandidate(DependencyDescriptor dependency)
Return TRUE is this model is capable of supporting a supplied depedendency.

Specified by:
isaCandidate in interface Model
Parameters:
dependency - the dependency descriptor
Returns:
true if this model can fulfill the dependency

isaCandidate

public boolean isaCandidate(StageDescriptor stage)
Return TRUE is this model is capable of supporting a supplied stage dependency.

Specified by:
isaCandidate in interface Model
Parameters:
stage - the stage descriptor
Returns:
TRUE if this model can fulfill the stage dependency

getCategories

public CategoriesDirective getCategories()
Return the logging categories.

Specified by:
getCategories in interface DeploymentModel
Returns:
the logging categories

getCollectionPolicy

public int getCollectionPolicy()
Return the collection policy for the model. If a profile does not declare a collection policy, then the collection policy declared by the underlying component type will be used.

Specified by:
getCollectionPolicy in interface DeploymentModel
Returns:
the collection policy
See Also:
InfoDescriptor.WEAK, InfoDescriptor.SOFT, InfoDescriptor.HARD, InfoDescriptor.UNDEFINED

setCollectionPolicy

public void setCollectionPolicy(int policy)
Set the collection policy for the model.

Specified by:
setCollectionPolicy in interface DeploymentModel
Parameters:
policy - the collection policy
See Also:
InfoDescriptor.WEAK, InfoDescriptor.SOFT, InfoDescriptor.HARD

setCategories

public void setCategories(CategoriesDirective categories)
Set categories.

Specified by:
setCategories in interface DeploymentModel
Parameters:
categories - the categories directive

getActivationPolicy

public boolean getActivationPolicy()
Return the activation policy for the model.

Specified by:
getActivationPolicy in interface DeploymentModel
Returns:
the activaltion policy

setActivationPolicy

public void setActivationPolicy(boolean policy)
Set the activation policy for the model.

Specified by:
setActivationPolicy in interface DeploymentModel
Parameters:
policy - the activaltion policy

revertActivationPolicy

public void revertActivationPolicy()
Set the activation policy for the model to the default value.

Specified by:
revertActivationPolicy in interface DeploymentModel

getType

public Type getType()
Return the component type descriptor.

Specified by:
getType in interface DeploymentModel
Returns:
the type descriptor

getDeploymentClass

public Class getDeploymentClass()
Return the class for the deployable target.

Specified by:
getDeploymentClass in interface DeploymentModel
Returns:
the class

isParameterizable

public boolean isParameterizable()
Rest if the component type backing the model is parameterizable.

Specified by:
isParameterizable in interface DeploymentModel
Returns:
TRUE if the compoent type is parameterizable otherwise FALSE

setParameters

public void setParameters(Parameters parameters)
Set the parameters to the supplied value. The supplied parameters value will replace the existing parameters value.

Specified by:
setParameters in interface DeploymentModel
Parameters:
parameters - the supplied parameters value
Throws:
IllegalStateException - if the component type backing the model does not implement the parameteriazable interface
NullPointerException - if the supplied parameters are null

setParameters

public void setParameters(Parameters parameters,
                          boolean policy)
                   throws IllegalStateException
Set the parameters to the supplied value. The supplied parameters value may suppliment or replace the existing parameters value.

Specified by:
setParameters in interface DeploymentModel
Parameters:
parameters - the supplied parameters
policy - if TRUE the supplied parameters replaces the current parameters value otherwise the existing and supplied values are aggregrated
Throws:
IllegalStateException - if the component type backing the model does not implement the parameteriazable interface
NullPointerException - if the supplied parameters are null

getParameters

public Parameters getParameters()
Return the parameters to be applied to the component.

Specified by:
getParameters in interface DeploymentModel
Returns:
the parameters

isConfigurable

public boolean isConfigurable()
Rest if the component type backing the model is configurable.

Returns:
TRUE if the component type is configurable otherwise FALSE

setConfiguration

public void setConfiguration(Configuration config)
                      throws IllegalStateException,
                             NullPointerException
Set the configuration to the supplied value. The supplied configuration will replace the existing configuration.

Specified by:
setConfiguration in interface DeploymentModel
Parameters:
config - the supplied configuration
Throws:
IllegalStateException - if the component type backing the model does not implement the configurable interface
NullPointerException - if the supplied configuration is null

setConfiguration

public void setConfiguration(Configuration config,
                             boolean policy)
                      throws IllegalStateException,
                             NullPointerException
Set the configuration to the supplied value. The supplied configuration may suppliment or replace the existing configuration.

Specified by:
setConfiguration in interface DeploymentModel
Parameters:
config - the supplied configuration
policy - if TRUE the supplied configuration replaces the current configuration otherwise the resoved configuration shall be layed above the configuration supplied with the profile which in turn is layer above the type default configuration (if any)
Throws:
IllegalStateException - if the component type backing the model does not implement the configurable interface
NullPointerException - if the supplied configuration is null

getConfiguration

public Configuration getConfiguration()
Return the configuration to be applied to the component. The implementation returns the current configuration state. If the the component type does not implementation the Configurable interface, the implementation returns null.

Specified by:
getConfiguration in interface DeploymentModel
Returns:
the qualified configuration

isContextDependent

public boolean isContextDependent()
Test if the component type backing the model requires the establishment of a runtime context.

Specified by:
isContextDependent in interface DeploymentModel
Returns:
TRUE if the component type requires a runtime context otherwise FALSE

getContextModel

public ContextModel getContextModel()
Return the context model for this deployment model.

Specified by:
getContextModel in interface DeploymentModel
Returns:
the context model if this model is context dependent, else the return value is null

getDependencyModels

public DependencyModel[] getDependencyModels()
Return the dependency models for this component type.

Specified by:
getDependencyModels in interface DeploymentModel
Returns:
the dependency models

getStageModels

public StageModel[] getStageModels()
Return the stage models for this component type.

Specified by:
getStageModels in interface DeploymentModel
Returns:
the stage models

getInterfaces

public Class[] getInterfaces()
Return the set of services produced by the model as a array of classes.

Specified by:
getInterfaces in interface DeploymentModel
Returns:
the service classes

toString

public String toString()
Overrides:
toString in class DefaultModel


Copyright © Apache Software Foundation. All Rights Reserved.