Re: [Nutch-cvs] svn commit: r414681 - /lucene/nutch/trunk/src/java/org/apache/nutch/protocol/ProtocolFactory.java

2006-06-18 Thread Sami Siren



+
+  if (conf.getObject(protocolName) != null) {
+return (Protocol) conf.getObject(protocolName);
+  } else {
+Extension extension = findExtension(protocolName);
+if (extension == null) {
+  throw new ProtocolNotFound(protocolName);
+}
  



I'm somewhat worried about the possible clash in the conf name-space 
-  usually, when we store Object's in Configuration instance, we use 
their full class name, or at least a long and most probably unique 
string. In this case, we use just http, https, ftp, file and 
so on ... Would it make sense if in this special case we used the 
X_POINT + protocolName as the unique string?


Perhaps I'm worrying too much ... ;)

I changed the code as you proposed. In the long run I would like to see 
this kind of caching stuff refactored to either Configuration
or to the plugin system or perhaps if we start using some kind of 
component container then there.


--
Sami Siren


Re: [Nutch-cvs] svn commit: r414681 - /lucene/nutch/trunk/src/java/org/apache/nutch/protocol/ProtocolFactory.java

2006-06-16 Thread Jérôme Charron

I'm somewhat worried about the possible clash in the conf name-space -
usually, when we store Object's in Configuration instance, we use their
full class name, or at least a long and most probably unique string. In
this case, we use just http, https, ftp, file and so on ...
Would it make sense if in this special case we used the X_POINT +
protocolName as the unique string?


+1
(why not using directly the extension id ?)


--
http://motrech.free.fr/
http://www.frutch.org/