avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anton Tagunov <atagu...@mail.cnt.ru>
Subject Re [2]: [Fortress] lookup contract [PATCH]
Date Mon, 19 May 2003 14:53:31 GMT
Hello, Berin!

Okay, all I wanted was to try clean up a bit the code that
sort of puzzled me :-)

Step #1
BL> [another thread] Actually, we *always* want a selector available.

This has cleared it all a bit for me!

--- AbstractContainer.orig      2003-05-16 09:49:00.000000000 +0400
+++ AbstractContainer.java      2003-05-19 18:47:30.000000000 +0400
@@ -347,17 +347,13 @@
                 {
                     hintMap = createHintMap();
                     hintMap.put( DEFAULT_ENTRY, handler );
+                    hintMap.put( SELECTOR_ENTRY,
+                        new FortressServiceSelector( this, role ) );
                     m_mapper.put( role, hintMap );
                 }
 
                 hintMap.put( metaData.getName(), handler );
 
-                if ( ( !hintMap.containsKey( SELECTOR_ENTRY ) ) && ( hintMap.size()
> 1 ) )
-                {
-                    hintMap.put( SELECTOR_ENTRY,
-                        new FortressServiceSelector( this, role ) );
-                }
-
                 if ( metaData.getConfiguration().getAttributeAsBoolean( "default", false
) )
                 {
                     hintMap.put( DEFAULT_ENTRY, handler );


Step #2

Probably we shall patch it all to allow default="ROLE-NAME",
only this would introduce these very-long names into config,
when we already use only these nice "jdbc-data-source" short
variants... Probably we could allow to put in only the last
part of the Role, say JdbcDataSource, but still this seems
to fall out of line with "jdbc-data-srouce" :-(

Something to still think about..

Step #3

My last idea on this was about how we choose the default
component if there's more then one for a role and none
is marked as 'default'. The idea was to create NO default
component -- that is FORSE THE CONFIG-WRITERS TO PUT
default='..' WHEN THERE'S MORE THEN ONE COMPONENT FOR A ROLE.

Good or bad idea?

- WBR, Anton


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org
For additional commands, e-mail: dev-help@avalon.apache.org


Mime
View raw message