Hi,

I just encounter the same problem, after switching to the current cvs-build.

the ContextManager initializes an instance of SourceResolverImpl in the
method initializeOwnComponentManager()
the SourceResolverImpl wants a SourceFactory in the service-method under the hint '*' and
the ContextManager sets it up under the hint 'resource'.

changing the 'resource'-String in the ContextManager does solve the problem, but
not the hardcoded dependency between these two classes.

see also attachment.

best wishes Kristian


Berin Loritsch wrote:

J Aaron Farr wrote:

--- Carsten Ziegeler <[EMAIL PROTECTED]> wrote:

Berin Loritsch wrote:

However, Fortress's ContextManager doesn't put a "*" in the

selector, all it

puts is:
      selector.put( "resource", resource );

Hmm.  that is a problem.  On two accounts:

In Fortress the default selection is "default".

It stems from no formal specs on what is the default.  We can easily
change what Fortress uses as the "default".


And the Avalon framework DefaultServiceSelector which is the

ServiceSelector

called above in the SourceResolverImpl code doesn't handle "*".

It literally

looks for a key "*" which doesn't exist.

Any suggestions?

Either update Fortress to use "*", or update SourceResolverImpl to use
"default".

The change mentioned above equalizes the source factory handling which means sources that wrap a URL are now handled in the same way as
sources that allow access to jar files, webdav etc. This is a long
wished feature which now finally got implemented.

Anyway, the source resolver needs to know what to do with a URI that
has a protocol where no source factory has registered for, for example
you don't want to register a factory for each protocol the jdk already
supports (ftp, http, https etc.)

Therefore the source resolver searches for a default factory; I thought
for this particular cases that "*" is a good choice, because a "real
name", like default could also be used for a protocol. So I choose
a name that is not a valid protocol name.
So I guess updating fortress is the way to go.


Carsten


So, if I'm following correctly, we'd need to change "default" to "*" in
AbstractContainer where the key/hint is set if no other value is given? (I
think it's lines 294, 444, 496). That's the only place where I can see what
Berin is referring to.

I'm not sure if this will completely solve the problem because as I'm following
the code, the m_manager ServiceManager variable in SourceResolverImpl only has
one entry in it at execution: the "resource" entry set in the ContextManager
as mentioned above. No other entries are present -- no "default" that I can
see. Is it not being set or will it be magically returned somehow? I'm going to play with the code a bit but any illumination would be nice.

Check the addComponent() method in AbstractContainer.

I will do the conversion myself in a few minutes.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
----------------------------------------------------------------------
Jentro AG
Kristian Meier, Developer
----------------------------------------------------------------------
Peter-Henlein-Strasse 28, 85540 Haar/Munich, Germany
Tel. +49 89 462 385 0     mailto:   [EMAIL PROTECTED]
Fax  +49 89 462 385 29    internet: http://www.jentro.com
----------------------------------------------------------------------
 { smart networks - connect your world }
----------------------------------------------------------------------


Index: src/java/org/apache/avalon/fortress/util/ContextManager.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/fortress/src/java/org/apache/avalon/fortress/util/ContextManager.java,v
retrieving revision 1.1
diff -u -r1.1 ContextManager.java
--- src/java/org/apache/avalon/fortress/util/ContextManager.java        27 Jan 2003 
16:55:42 -0000      1.1
+++ src/java/org/apache/avalon/fortress/util/ContextManager.java        31 Jan 2003 
+14:15:56 -0000
@@ -599,7 +599,7 @@
         final DefaultServiceSelector selector = new DefaultServiceSelector();
         final ResourceSourceFactory resource = new ResourceSourceFactory();
         resource.enableLogging( getLogger() );
-        selector.put( "resource", resource );
+        selector.put( "*", resource );
 
         manager.put( resource.ROLE + "Selector", selector );
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to