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

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.composition.model.impl.DefaultDependent
          extended byorg.apache.avalon.composition.model.impl.DefaultDependencyModel
All Implemented Interfaces:
DependencyModel, Dependent, LogEnabled

public class DefaultDependencyModel
extends DefaultDependent
implements DependencyModel

Default implementation of the deplendency model.

Version:
$Revision: 1.9 $ $Date: 2004/03/17 10:39:10 $
Author:
Avalon Development Team

Constructor Summary
DefaultDependencyModel(Logger logger, String partition, String name, DependencyDescriptor descriptor, DependencyDirective directive)
          Creation of a new dependency model.
 
Method Summary
 ServiceDescriptor[] filter(ServiceDescriptor[] candidates)
          Filter a set of candidate service descriptors and return the set of acceptable service as a ordered sequence.
 DependencyDescriptor getDependency()
          Return the dependency descriptor.
 String getPath()
          Return an explicit path to a supplier component.
 
Methods inherited from class org.apache.avalon.composition.model.impl.DefaultDependent
clearProvider, getProvider, setProvider
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.composition.model.Dependent
clearProvider, getProvider, setProvider
 

Constructor Detail

DefaultDependencyModel

public DefaultDependencyModel(Logger logger,
                              String partition,
                              String name,
                              DependencyDescriptor descriptor,
                              DependencyDirective directive)
                       throws ModelException
Creation of a new dependency model.

Parameters:
logger - the logging channel
partition - the partition
name - the name
descriptor - the dependency descriptor
directive - the dependency directive (possibly null)
Method Detail

getDependency

public DependencyDescriptor getDependency()
Return the dependency descriptor.

Specified by:
getDependency in interface DependencyModel
Returns:
the descriptor

getPath

public String getPath()
Return an explicit path to a supplier component. If a dependency directive has been declared and the directive contains a source declaration, the value returned is the result of parsing the source value relative to the absolute address of the implementing component.

Specified by:
getPath in interface DependencyModel
Returns:
the explicit path

filter

public ServiceDescriptor[] filter(ServiceDescriptor[] candidates)
Filter a set of candidate service descriptors and return the set of acceptable service as a ordered sequence.

Specified by:
filter in interface DependencyModel
Parameters:
candidates - the set of candidate services for the dependency matching the supplied key
Returns:
the accepted candidates in ranked order
Throws:
IllegalArgumentException - if the key is unknown


Copyright © The Apache Software Foundation. All Rights Reserved.