You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Oleg Kalnichevski <ol...@apache.org> on 2007/02/02 10:00:47 UTC

[HttpCore] java.net.URI was Re: [jira] Resolved: (HTTPCORE-36) HttpRequestHandlerRegistry configuration

On Fri, 2007-02-02 at 09:51 +0100, Stojce Dimski wrote:
> I mean in the whole HttpCore not in the context of this patch...
> > But looking at the code I am wondering when dealing with uri's why are
> > they defined as simple java.lang.String instead of java.net.URI ? Is
> > there some particular reason ?
> 

Hi Stojce,

The answer is very simple: java.net.URI is available as of Java 1.4,
whereas we would like to keep HttpCore (main module) Java 1.3 compatible

As far as HttpRequestHandlerRegistry goes, URI parsing is a more
expensive operation compared to the #indexOf / #substring combo. I felt
parsing the while damn thing just to strip away the query part was not
justified 

Oleg

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


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


Re: [HttpCore] java.net.URI was Re: [jira] Resolved: (HTTPCORE-36) HttpRequestHandlerRegistry configuration

Posted by Roland Weber <ht...@dubioso.net>.
Hi Oleg,

> Yes, we could. I am still of an opinion we ought not have impl.protocol
> and should support everything that has to do with HTTP protocol layer as
> a part of official API but I will not object if we did otherwise. 

I'll think about it. Let's leave it as it is for now.

cheers,
  Roland


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


Re: [HttpCore] java.net.URI was Re: [jira] Resolved: (HTTPCORE-36) HttpRequestHandlerRegistry configuration

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2007-02-02 at 17:06 +0100, Roland Weber wrote:
> Hi Oleg,
> 
> >> I wonder whether URI parsing should be in HttpCore at all, in particular
> >> in an API package.
> >>  At the very least we should
> >> have an interface so that the implementation can be replaced.
> >>
> > 
> > We already do:
> > 
> > HttpRequestHandlerResolver
> > 
> > I hope this addresses your concerns
> 
> So we could move HttpRequestHandlerRegistry to
> o.a.h.impl.protocol.DefaultHttpRequestHandlerResolver?
> 

Yes, we could. I am still of an opinion we ought not have impl.protocol
and should support everything that has to do with HTTP protocol layer as
a part of official API but I will not object if we did otherwise. 

Oleg

> cheers,
>   Roland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


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


Re: [HttpCore] java.net.URI was Re: [jira] Resolved: (HTTPCORE-36) HttpRequestHandlerRegistry configuration

Posted by Roland Weber <ht...@dubioso.net>.
Hi Oleg,

>> I wonder whether URI parsing should be in HttpCore at all, in particular
>> in an API package.
>>  At the very least we should
>> have an interface so that the implementation can be replaced.
>>
> 
> We already do:
> 
> HttpRequestHandlerResolver
> 
> I hope this addresses your concerns

So we could move HttpRequestHandlerRegistry to
o.a.h.impl.protocol.DefaultHttpRequestHandlerResolver?

cheers,
  Roland


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


Re: [HttpCore] java.net.URI was Re: [jira] Resolved: (HTTPCORE-36) HttpRequestHandlerRegistry configuration

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2007-02-02 at 16:45 +0100, Roland Weber wrote:
> Hi Oleg,
> 
> > As far as HttpRequestHandlerRegistry goes, URI parsing is a more
> > expensive operation compared to the #indexOf / #substring combo. I felt
> > parsing the while damn thing just to strip away the query part was not
> > justified 
> 
> I wonder whether URI parsing should be in HttpCore at all, in particular
> in an API package. I guess you needed that class for the various server
> examples, but I feel that you are pushing the limits of HttpCore when
> you're doing URL-based request dispatching.

Hi Roland,

I know and fully agree. But I could not find another approach which
would make HttpService usable without subclassing

>  At the very least we should
> have an interface so that the implementation can be replaced.
> 

We already do:

HttpRequestHandlerResolver

I hope this addresses your concerns

Oleg


> cheers,
>   Roland
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


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


Re: [HttpCore] java.net.URI was Re: [jira] Resolved: (HTTPCORE-36) HttpRequestHandlerRegistry configuration

Posted by Roland Weber <ht...@dubioso.net>.
Hi Oleg,

> As far as HttpRequestHandlerRegistry goes, URI parsing is a more
> expensive operation compared to the #indexOf / #substring combo. I felt
> parsing the while damn thing just to strip away the query part was not
> justified 

I wonder whether URI parsing should be in HttpCore at all, in particular
in an API package. I guess you needed that class for the various server
examples, but I feel that you are pushing the limits of HttpCore when
you're doing URL-based request dispatching. At the very least we should
have an interface so that the implementation can be replaced.

cheers,
  Roland



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