Hello, Developers!
ComponentFactory.java
name = configuration.getAttribute( "id" );
m_context.put( "component.name", name );
InstrumentableCreator.java says (pseudocode)
instrumentableName = context.get( "component.name" );
m_instrumentManager.registerInstrumentable( ..., instrumentableName );
So, id - > instrumentableName
But this is quite flat - if we have a hierarchy of nested containers
all ids will come mixed together. Is it okay?
One could imagine that if we have a hierarchy of containers
A
|
+----+
| |
B C
then the instrumentable names could be
A
A.B
A.C
rather then
A
B
C
one reason to want this is name clash avoidance.
(Yes, the config design subsumes that id-s are unique, it's XML after
all, but what if a child container reads its config from its own
config file or employs some other mechanims for addCompoenent, other
then configuration?)
----
If this topic is sufficently interesting, then I could add
that besides the containers hierarchy ( I imagine, we could
create a child InstrumentManager in each container and this
child InstrumentManager would do
public class NestedInstrumentManager impelements InstrumentManager
{
protected InstrumentManager m_parent;
protected String m_prefix;
public NestedInstrumentManager( InstrumentManager parent, String
name )
{
m_parent = parent;
m_name = name;
void registerInstrumentable( Instrumentable instrumentable,
String instrumentableName )
throws Exception
{
m_parent.registerInstrumentable( instrumentable, m_name + "." +
instrumentableName );
}
}
BTW, is this a good idea?
Well, even while we could do this the picture is cluttered
(at least for me) with the fact that the Instrumentable interface
itself introduces a hierarchy via the getChildInstrumentables()
method. Should it be better ignored and it is better inside
fortress to build a hierarchy of InstrumentManagers as shown above?
And what puzzles me even more is that there are (theoretically)
two ways for nested containers in Fortress to obtain an
InstrumentManager:
* via lookup( InstrumentManager.ROLE ), like it is now
* implement InstrumentManageable interface
I've lost my way completely with this :-)
- Anton
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]