Re: Relieving some ClassLoader contention in PreferredClassProvider

Mark Brouwer <[email protected]>
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Bob Scheifler wrote:
>> As URL.equals() is heavily used in the synchronized block from where the
>> class loader creation takes place it means in the case that URL.equals
>> takes a very long time all operation that ultimately result in the
>> creation of a class loader are blocked.
>
> So perhaps one should start by looking at alternate synchronization,
> rather than alternate specification.

Valid point, though preventing from the problems as pointed out doesn't
seem very easy to me considering URLs being part of the keys to be put
in a synchronized map considering you want to stay at 1.4.

Curious though what Gregg comes up with.

> I'm looking for you to expand on that. In particular, if all of the
> URLs are HTTPMD:, what real problem can arise from equivalence?

I guess none, but not all URLs are HTTPMD are they?

>> BTW Bob can you come up with an example of a URL that can't be
>> recognized as a valid URI according to RFC 2396 and that might have been
>> a workable codebase annotation, I tried to find an example but I
>> couldn't.
>
> new URL("http://foo[]bar.jar").toURI()

Thanks, you are right, only a URISyntaxException is thrown. But I don't
get it, from RFC 1738:

   httpurl = "http://" hostport [ "/" hpath [ "?" search ]]

This means that foo[]bar.jar must be a host name:

   hostport       = host [ ":" port ]
   host           = hostname | hostnumber
   hostname       = *[ domainlabel "." ] toplabel
   domainlabel    = alphadigit | alphadigit *[ alphadigit | "-" ]
                    alphadigit
   toplabel       = alpha | alpha *[ alphadigit | "-" ] alphadigit
   alphadigit     = alpha | digit
   hostnumber     = digits "." digits "." digits "." digits
   port           = digits

So or I must be overlooking something, but to me it seems
http://foo[]bar.jar is no valid URL as foo[]bar.jar is no valid host name.

My approach to URISyntaxException was to convert it to a
MalformedURLException, but I guess you already suspected that?
--
Mark

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.