org.apache.avalon.composition.data
Class ContextDirective

java.lang.Object
  extended byorg.apache.avalon.composition.data.ContextDirective
All Implemented Interfaces:
Serializable

public class ContextDirective
extends Object
implements Serializable

A context descriptor declares the context creation criteria for the context instance and context entries.

XML

A context directive may contain multiple import statements. Each import statement corresponds to a request for a context value from the container.

    <context class="MyContextClass">
       <entry key="special">
         <import key="urn:avalon:classloader"/>
       </entry>
       <entry key="xxx">
         <param class="MySpecialClass">
           <param>hello</param>
           <param class="java.io.File">../lib</param>
         </param>
       </entry>
    </context>
 

Version:
$Revision: 1.1.1.1 $ $Date: 2003/08/31 14:26:49 $
Author:
Avalon Development Team
See Also:
EntryDirective, Serialized Form

Constructor Summary
ContextDirective(EntryDirective[] entries)
          Creation of a new file target.
ContextDirective(String classname, EntryDirective[] entries)
          Creation of a new file target.
ContextDirective(String classname, EntryDirective[] entries, String source)
          Creation of a new file target.
 
Method Summary
 String getClassname()
          Return the classname of the context implementation to use.
 EntryDirective getEntryDirective(String key)
          Return a named entry.
 EntryDirective[] getEntryDirectives()
          Return the set of entry directives.
 String getSource()
          Return the relative path to a source provider component that will handle a custom contextualization phase implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextDirective

public ContextDirective(EntryDirective[] entries)
Creation of a new file target.

Parameters:
entries - the set of entry descriptors

ContextDirective

public ContextDirective(String classname,
                        EntryDirective[] entries)
Creation of a new file target.

Parameters:
classname - the context implementation class
entries - the set of entry descriptors

ContextDirective

public ContextDirective(String classname,
                        EntryDirective[] entries,
                        String source)
Creation of a new file target.

Parameters:
classname - the context implementation class
entries - the set of entry descriptors
source - a path to a source component for contextualization phase handling
Method Detail

getSource

public String getSource()
Return the relative path to a source provider component that will handle a custom contextualization phase implementation.

Returns:
the source path

getClassname

public String getClassname()
Return the classname of the context implementation to use.

Returns:
the classname

getEntryDirectives

public EntryDirective[] getEntryDirectives()
Return the set of entry directives.

Returns:
the entries

getEntryDirective

public EntryDirective getEntryDirective(String key)
Return a named entry.

Parameters:
key - the context entry key
Returns:
the entry corresponding to the supplied key or null if the key is unknown


Copyright © Apache Software Foundation. All Rights Reserved.