KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > web > talk > plugin > DbPing


1 /*
2  * DbPing.java
3  *
4  * Created on May 26, 2002, 11:07 AM
5  */

6
7 package com.quikj.application.web.talk.plugin;
8
9 import com.quikj.server.framework.*;
10 import com.quikj.server.web.*;
11
12 /**
13  *
14  * @author amit
15  */

16 public class DbPing implements com.quikj.application.web.talk.plugin.DbOperationInterface
17 {
18     
19     /** Creates a new instance of DbPing */
20     public DbPing(ServiceController parent, AceSQL sql)
21     {
22         this.parent = parent;
23         this.sql = sql;
24     }
25     
26     public void ping()
27     {
28         operationId = sql.executeSQL("show databases",
29         parent,
30         this);
31         //System.out.println ("sent ping: " + operationId);
32
}
33     
34     public void cancel()
35     {
36         if (operationId != -1)
37         {
38             sql.cancelSQL(operationId);
39         }
40     }
41     
42     public EndPointInterface getEndPoint()
43     {
44         return null;
45     }
46     
47     public boolean processResponse(AceSQLMessage message)
48     {
49         //System.out.println ("Received ping response");
50
operationId = -1;
51         return false;
52     }
53     
54     private ServiceController parent;
55     private AceSQL sql;
56     private int operationId = -1;
57 }
58
Popular Tags