Re: context

J Aaron Farr <[email protected]> Wed, 24 Nov 2004 08:58:43 -0500
Newsgroups gmane.comp.jakarta.avalon.user
Message-ID <[email protected]>
Samuel Ferrer wrote:

> I think, and guys correct me if I am wrong, the context is the container 
> in which a component is running.

One of the original Avalon Framework lifecyles was "Contextualize" [1]. 
  During this phase, the component would be passed a "Context" object 
(org.apache.avalon.framework.context.Context) by the container.  The 
context object would contain a map of values that would help the 
component know about the container environment such a container home 
directory.  You can think of the Avalon context as similar to a 
ServletContext for servlets, only an Avalon context is read only.  Only 
the container can set the context values.

However, part of the trouble with the Contextualize lifecycle was that 
the framework did not specify any standard context values.  As such, 
each Avalon container had a different set of similar context values [2].

So, in the end, you're about right when you say "the context is the 
container in which a component is running" but it might be better to 
say, "the context is a map of information about the container 
environment in which the component is running."

Also, if you're just getting into Avalon, please be aware the project is 
splitting.  You might also be interested in looking at the documentation 
at Apache Excalibur (http://excalibur.apache.org) or Codehaus Loom 
(http://loom.codehaus.org) in addition to that over at DPML.

jaaron

[1] http://avalon.apache.org/framework/principals/lifecycle.html
[2] http://wiki.apache.org/avalon/AvalonContextSurvey