jsky.util
Class ConnectionUtil

java.lang.Object
  extended by jsky.util.ConnectionUtil

public class ConnectionUtil
extends java.lang.Object

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.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

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

ConnectionUtil

public ConnectionUtil(java.net.URL url)
Initialize with the given URL

Method Detail

openConnection

public java.net.URLConnection openConnection()
                                      throws java.io.IOException
Throws:
java.io.IOException

interrupt

public void interrupt()
Interrupt the connection