Link to home
Start Free TrialLog in
Avatar of heech
heech

asked on

URLStreamHandler Help

I'm trying to create a custom URLStreamHandlerFactory, but also I need to change this factory at times...specifically
in individual threads.

The API reference for JDK 1.1 says the URL.SetURLStreamHandlerFactory function can only
be called once in an application.  Does this apply
to individual threads?  Or does it really mean once
in an application?  Are there any workarounds?
ASKER CERTIFIED SOLUTION
Avatar of JWBito
JWBito

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of heech
heech

ASKER

Hmm... There is a problem...

Apparently URLStreamHandlerFactory is only called once
for each specific protocol...

My solution, I think, will be to create a URLStreamHandler,
(as well as a URLStreamHandlerFactory) which _is_ called by
different threads, and will be able to return the URLConenction
as necessary.. this takes out some of the functionality
I had hoped for..but should still be acceptable.