|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjsky.util.ConnectionUtil
public class ConnectionUtil
A utility class for getting a URL connection in a background thread without hanging. Used to solve the problem of a background thread hanging (even after calling Thread.interrupt()) while waiting for URL.openConnection() to return.
| Constructor Summary | |
|---|---|
ConnectionUtil(java.net.URL url)
Initialize with the given URL |
|
| Method Summary | |
|---|---|
void |
interrupt()
Interrupt the connection |
java.net.URLConnection |
openConnection()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionUtil(java.net.URL url)
| Method Detail |
|---|
public java.net.URLConnection openConnection()
throws java.io.IOException
java.io.IOExceptionpublic void interrupt()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||