Re: Relieving some ClassLoader contention in PreferredClassProvider
Peter Jones <[email protected]>
| Newsgroups | gmane.comp.java.sun.jini |
|---|---|
| Message-ID | <20070105155843.GA17295@east> |
On Thu, Jan 04, 2007 at 04:56:41PM -0600, Gregg Wonderly wrote: > > Peter Jones wrote: > >> Just to be clear, is the network activity that you are concerned about >> only the name->address resolution done by SocketPermission.implies >> during PreferredClassProvider.createClassLoader? Or is it also the >> resolution potentially done by URL.equals during the table lookup and >> the "boomerang" search (PreferredClassProvider.findOriginLoader)? > > I am interested in acceptable behavior in both cases. The > .implies() is one thing that causes all URLs to be queried (one > optimization I added was to check for an HttpURLConnection instance > and request a "HEAD" instead of "GET"). A non operating codebase > host, will hang all threads for at least the TCP timeout period > foreach URL.openConnection() at least. So, I am really concerned > overall about minimizing the impact any particular failure has on > unrelated threads. Wait, are you suggesting that an actual HTTP request is attempted during the process of getting the permission for each codebase URL? That is certainly not expected (or desired), so if it is indeed happening for you, then something is wrong and we need to figure out why (and I wonder if it is the high order cause of the problems that you have been seeing). Despite its name, invoking URL.openConnection (or invoking getPermission on the returned URLConnection) is not supposed to actually make an HTTP connection (see the main class doc for URLConnection-- only connect() and other methods that require a connection to be made should do so). So the procedure done by PreferredClassLoader.addPermissionsForURLs should not cause any HTTP connections to the codebase URLs-- only perhaps host name->address resolution because of what SocketPermission.implies does. -- Peter -------------------------------------------------------------------------- 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]