Vjeran Marcinko wrote:

Hi.
Since nobody replied on my last post, I'll ask again in a more simple way ...
Is there a way to configure some component instance during runtime beside awkwardly defining some config method in components role, because configure/parameterize methods are called by some container implementation automaticaly, and these parameters have to be known during design time (inside .xconf) ?

The answer to your question is dependent on the container you are using, and the application context your dealing with. The following comments are based on different options available under the Merlin 2 container.

1. static configuration of a component at design time

Static configuration referers to the association of
a configuration with a class during development - it
is typically used to establish default configuration
values and can be modified by the addition of
configuration information introduced at assembly time.
In Merlin static configurations are contained in a
file name <classname>.xconf.

2. configuration of a component declared at assembly time

Merlin provides support for the declaration component
profiles inside an XML file. Component profiles include
information about the configuration to be applied to
the component type, along with information about logging,
copntext directives, etc. Unlike static configurations
the information supplied under the <configuration> tag
with a <component> declaration can be modified without
rebuilding the application.

3. dynamic configuration of components at runtime

Merlin provides support for programatic assembly and
deployment of components. Unlike the assembly phase, a
developer can use the Merlin API to create a deployment
profile (which includes the configuration information to
be used), then supply this profile to Merlin. Merlin
will will handle the resolution of component dependecies
and validation of things like context requirements, logging
channels and so on. The object returned is a reference to
the component profile. Accessing the value of the reference
will cause Merlin to handle instantiation, assembly, and
lifestyle processing (including configuration based on the
information supplied under the constructed profile).

Hope that helps.

Cheers, Steve.

Or maybe I'm missing something here and not thinking COP way ?

-Vjeran



--
To unsubscribe, e-mail: <mailto:avalon-users-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>




--

Stephen J. McConnell

OSM SARL
digital products for a global economy
mailto:mcconnell@;osm.net
http://www.osm.net




--
To unsubscribe, e-mail:   <mailto:avalon-users-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>

Reply via email to