how to implement request time out exception
<p>thi is my code below which i used to get xml reponse forms erver how do i implement request time out exception in this code??? please help me how i modify this code for implement request time out exception???   </p>

<pre><code>public static   String[][] AgAppXMLParser( String parUrl) {
    flag = true;
    String _node,_element;
    String[][] xmlRespone = null;
    HttpURLConnection urlConnection = null;
    try {
        String url = AgAppHelperMethods.getUrl() + parUrl;
        URL finalUrl = new URL(url);    
        urlConnection = (HttpURLConnection) finalUrl.openConnection();
        urlConnection.connect();
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document doc = db.parse(finalUrl.toString());
        doc.getDocumentElement().normalize();

        NodeList list=doc.getElementsByTagName("*");
        _node=new String();
        _element = new String();
        xmlRespone = new String[list.getLength()][2];

        //this "for" loop is used to parse through the
        //XML document and extract all elements and their
        //value, so they can be displayed on the device

        for (int i=0;i&lt;list.getLength();i++)
        {
            Node value=list.item(i).getChildNodes().item(0);
            _node=list.item(i).getNodeName();
            _element=value.getNodeValue();
            xmlRespone[i][0] = _node;
            xmlRespone[i][1] = _element;
        }//end for

        urlConnection.disconnect();
    }//end try
    catch (Exception e)
    {
        flag=false;
        Log.e(LOG_TAG, "CONNECTION ERROR   SERVER NOT RESPONDING", e);
    }
}
</code></pre>
