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

java.lang.Object
  extended byorg.apache.avalon.composition.model.impl.DefaultDeploymentModel
All Implemented Interfaces:
Commissionable, DeploymentModel, Resolver
Direct Known Subclasses:
DefaultComponentModel, DefaultContainmentModel

public abstract class DefaultDeploymentModel
extends Object
implements DeploymentModel

Abstract model base class.

Version:
$Revision: 1.22 $ $Date: 2004/04/04 23:33:56 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.avalon.composition.model.DeploymentModel
DEPLOYMENT_TIMEOUT_KEY, SEPARATOR
 
Constructor Summary
DefaultDeploymentModel(DeploymentContext context, SecurityModel security)
          Creation of an abstract model.
 
Method Summary
 void commission()
          Commission the model.
 void decommission()
          Decommission the model.
 boolean equals(Object other)
           
 AccessControlContext getAccessControlContext()
          Return the access control context.
 CategoriesDirective getCategories()
          Return the logging categories.
 DeploymentModel[] getConsumerGraph()
          Return the set of models consuming this model.
 long getDeploymentTimeout()
          Return the default deployment timeout value declared in the kernel configuration.
 Logger getLogger()
          Return the assigned logging channel.
 Mode getMode()
          Return the mode of establishment.
 String getName()
          Return the profile name.
 String getPath()
          Return the profile path.
 Permissions getPermissions()
          Return the assigned permissions.
 DeploymentModel[] getProviderGraph()
          Return the set of models supplying this model.
 String getQualifiedName()
          Return the model fully qualified name.
 void release(Object instance)
          Release an object
 Object resolve()
          Resolve a object to a value.
 Object resolve(boolean proxy)
          Resolve a object to a value.
 void setCategories(CategoriesDirective categories)
          Set categories.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.composition.model.DeploymentModel
getProviders, getServices, isaCandidate, isaCandidate, isaCandidate, isAssembled
 

Constructor Detail

DefaultDeploymentModel

public DefaultDeploymentModel(DeploymentContext context,
                              SecurityModel security)
Creation of an abstract model. The model associated a name and a partition.

Parameters:
context - the deployment context
Method Detail

commission

public void commission()
                throws Exception
Commission the model.

Specified by:
commission in interface Commissionable
Throws:
Exception - if a commissioning error occurs

decommission

public void decommission()
Decommission the model. Once an model is decommissioned it may be re-commissioned.

Specified by:
decommission in interface Commissionable

resolve

public Object resolve()
               throws Exception
Resolve a object to a value.

Specified by:
resolve in interface Resolver
Returns:
the resolved object
Throws:
Exception - if an error occurs

resolve

public Object resolve(boolean proxy)
               throws Exception
Resolve a object to a value.

Specified by:
resolve in interface Resolver
Parameters:
proxy - if TRUE ruturn a proxied reference if the underlying component suppports proxied representation otherwise return the raw component instance
Returns:
the resolved object
Throws:
Exception - if an error occurs

release

public void release(Object instance)
Release an object

Specified by:
release in interface Resolver
Parameters:
instance - the object to be released

getName

public String getName()
Return the profile name.

Specified by:
getName in interface DeploymentModel
Returns:
the name

getPath

public String getPath()
Return the profile path.

Specified by:
getPath in interface DeploymentModel
Returns:
the path

getQualifiedName

public String getQualifiedName()
Return the model fully qualified name.

Specified by:
getQualifiedName in interface DeploymentModel
Returns:
the fully qualified name

getMode

public Mode getMode()
Return the mode of establishment.

Specified by:
getMode in interface DeploymentModel
Returns:
the mode

getConsumerGraph

public DeploymentModel[] getConsumerGraph()
Return the set of models consuming this model.

Specified by:
getConsumerGraph in interface DeploymentModel
Returns:
the consumers

getProviderGraph

public DeploymentModel[] getProviderGraph()
Return the set of models supplying this model.

Specified by:
getProviderGraph in interface DeploymentModel
Returns:
the providers

getLogger

public Logger getLogger()
Return the assigned logging channel.

Specified by:
getLogger in interface DeploymentModel
Returns:
the logging channel

getPermissions

public Permissions getPermissions()
Return the assigned permissions.

Returns:
the permissions

getAccessControlContext

public AccessControlContext getAccessControlContext()
Return the access control context.

Specified by:
getAccessControlContext in interface DeploymentModel
Returns:
the access control context

toString

public String toString()

equals

public boolean equals(Object other)

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

getCategories

public CategoriesDirective getCategories()
Return the logging categories.

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

setCategories

public void setCategories(CategoriesDirective categories)
Set categories.

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


Copyright © The Apache Software Foundation. All Rights Reserved.