Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] NTLM support (was Versioning fun with Aether milestones)

Hi Benjamin,

>> Unfortunately, HttpTransporterFactory is final (why?)
> 
> Oh that's a simple question: Subclassing that isn't supported. Whatever
> use cases folks might have for this, they are expected to present them
> to the Aether project so that we can figure out an approach that can be
> well supported. I have history with a project where pretty much every
> class is public and non-final and the uncontrolled (ab-)use of that made
> its evolution a PITA.

fair enough. Subclassing certainly isn't the world's foremost
extensibility mechanism, just the easiest (besides copy & paste)
available to me right now.

But saving yourself pain in the future is a valid point.

>> Now, all one would need to do with HttpTransporter is to sneak in a
>> single line [2]:
>>
>>> httpclient.getAuthSchemes().register("ntlm", new NTLMSchemeFactory());
>>
>> Alas, aether-transport-http's HttpTransport is extremely difficult to
>> extend. Would it be possible to restructure HttpTransporter such that
>> one can supply a different(ly configured) HttpClient?
> 
> For similar reasons to the above, I have reservations towards exposing
> the HttpClient instance for full access by 3rd-parties. AFAICT, your
> immediate need could be fulfilled via a simple config property that
> provides the NTLM impl. This not needing any changes to API, should even
> be suitable for a 0.9.1 release.

Yes, if different AuthSchemeFactorys could be injected into the
HttpTransporterFactory (using SPI, Guice, whatever) that would be a much
cleaner design.

Alas, that would mean that there will be a new uses constraint:

  Export-Package:
    org.eclipse.aether.transport.http;uses:="org.apache.http.auth"

And that, I think, is a bad thing.

Or did I misunderstand you when you said "config property"? Did you have
something more like system properties in mind. If so, how would class
loading work in an OSGi container?

Best wishes,

Andreas

-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top