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

java.lang.Object
  extended byorg.apache.avalon.framework.context.DefaultContext
      extended byorg.apache.avalon.composition.model.impl.DefaultDeploymentContext
All Implemented Interfaces:
Context, DeploymentContext

public class DefaultDeploymentContext
extends DefaultContext
implements DeploymentContext

Default implementation of a deployment context.

Version:
$Revision: 1.2 $ $Date: 2003/10/28 20:21:00 $
Author:
Avalon Development Team

Field Summary
 
Fields inherited from interface org.apache.avalon.composition.model.DeploymentContext
CLASSLOADER_KEY, HOME_KEY, NAME_KEY, PARTITION_KEY, TEMP_KEY
 
Constructor Summary
DefaultDeploymentContext(Logger logger, String name, ContainmentContext context, DeploymentProfile profile, Type type, Class clazz, File home, File temp, String partition)
          Creation of a new deployment context.
 
Method Summary
 ClassLoader getClassLoader()
          Return the classloader for the component.
 ContainmentContext getContainmentContext()
          Return the containment context.
 Class getDeploymentClass()
          Return the component class.
 File getHomeDirectory()
          Return the working directory.
 Logger getLogger()
          Return the logging channel.
 String getName()
          Return the name that the component will execute under.
 String getPartitionName()
          Return the partition name that the component will execute within.
 DeploymentProfile getProfile()
          Return the deployment profile.
 SystemContext getSystemContext()
          Return the system context.
 File getTempDirectory()
          Return the temporary directory.
 Type getType()
          Return the component type.
 void register(EntryModel model)
          Add a context entry model to the deployment context.
 Object resolve(String alias)
          Get a context entry from the deployment context.
 
Methods inherited from class org.apache.avalon.framework.context.DefaultContext
checkWriteable, get, getContextData, getParent, hide, makeReadOnly, put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDeploymentContext

public DefaultDeploymentContext(Logger logger,
                                String name,
                                ContainmentContext context,
                                DeploymentProfile profile,
                                Type type,
                                Class clazz,
                                File home,
                                File temp,
                                String partition)
Creation of a new deployment context.

Parameters:
logger - the logging channel to assign
name - the deployment context name
context - the containment context in which this deployment context is scoped
profile - the deployment profile
type - the underlying component type
clazz - the compoent deployment class
home - the home working directory
temp - a temporary directory
partition - the partition name
Method Detail

getPartitionName

public String getPartitionName()
Return the partition name that the component will execute within.

Specified by:
getPartitionName in interface DeploymentContext
Returns:
the partition name

getName

public String getName()
Return the name that the component will execute under.

Specified by:
getName in interface DeploymentContext
Returns:
the name

getSystemContext

public SystemContext getSystemContext()
Return the system context.

Specified by:
getSystemContext in interface DeploymentContext
Returns:
the system context

getContainmentContext

public ContainmentContext getContainmentContext()
Return the containment context.

Specified by:
getContainmentContext in interface DeploymentContext
Returns:
the containment context

getHomeDirectory

public File getHomeDirectory()
Return the working directory.

Specified by:
getHomeDirectory in interface DeploymentContext
Returns:
the working directory

getTempDirectory

public File getTempDirectory()
Return the temporary directory.

Specified by:
getTempDirectory in interface DeploymentContext
Returns:
the temporary directory

getLogger

public Logger getLogger()
Return the logging channel.

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

getProfile

public DeploymentProfile getProfile()
Return the deployment profile.

Specified by:
getProfile in interface DeploymentContext
Returns:
the profile

getType

public Type getType()
Return the component type.

Specified by:
getType in interface DeploymentContext
Returns:
the type defintion

getDeploymentClass

public Class getDeploymentClass()
Return the component class.

Specified by:
getDeploymentClass in interface DeploymentContext
Returns:
the class

getClassLoader

public ClassLoader getClassLoader()
Return the classloader for the component.

Specified by:
getClassLoader in interface DeploymentContext
Returns:
the classloader

register

public void register(EntryModel model)
Add a context entry model to the deployment context.

Specified by:
register in interface DeploymentContext
Parameters:
model - the entry model
Throws:
IllegalArgumentException - if model key is unknown

resolve

public Object resolve(String alias)
               throws ContextException
Get a context entry from the deployment context.

Specified by:
resolve in interface DeploymentContext
Parameters:
alias - the entry lookup key
Returns:
value the corresponding value
Throws:
ContextException - if the key is unknown
ModelRuntimeException - if the key is unknown


Copyright © Apache Software Foundation. All Rights Reserved.