KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > tableappclient > business > TableNodeImpl


1 package tableappclient.business;
2
3 /**
4  * <p>Title: </p>
5  * <p>Description: </p>
6  * <p>Copyright: Copyright (c) 2005</p>
7  * <p>Company: </p>
8  * @author not attributable
9  * @version 1.0
10  */

11 import tableappclient.spec.TableNode;
12 import tableappclient.business.axis.*;
13 import org.w3c.dom.Node JavaDoc;
14 import org.w3c.dom.NodeList JavaDoc;
15 import org.w3c.dom.Document JavaDoc;
16
17 public class TableNodeImpl
18     implements TableNode {
19   static String JavaDoc TABLE="TABLE";
20   public TableNodeImpl() {};
21   public Node getTableNode(String JavaDoc hostName, String JavaDoc portNum) {
22     try {
23
24      WelcomePresentationService service = new
25          WelcomePresentationServiceLocator();
26          
27      WelcomePresentation welcome;
28      welcome = service.gettableApp(new java.net.URL JavaDoc("http://"+hostName+":"+portNum+"/tableApp/tableApp"));
29      Document JavaDoc doc = welcome.tableDoc();
30      if(doc==null){
31        return null;
32      }
33      NodeList JavaDoc nodeList = doc.getElementsByTagName(TABLE);
34      return nodeList.item(0);
35
36    }
37    catch (Exception JavaDoc e) {
38      e.printStackTrace();
39      return null;
40    }
41   }
42 }
Popular Tags