-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPoller.java
More file actions
48 lines (37 loc) · 1.18 KB
/
Copy pathPoller.java
File metadata and controls
48 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package sharedPackage;
/**
* Created by chees on 2/2/2018.
*/
class Poller implements Runnable {
//different thread
public void run(){ //throws InterruptedException {
//int seqId = 0;
ClientFacade myFacade = new ClientFacade();
try {
while (true) {
fullPoll(myFacade);
Thread.sleep(6000);
}
}
catch (InterruptedException myException){
System.out.println("not able to sleep");
}
}
public void fullPoll(ClientFacade currentFacade) { //throws InterruptedException {
//Statement st = dbConnection.createStatement();
//ResultSet rs = st.executeQuery("select * from msg_new_to_bde where ACTION = 804 and SEQ >" + lastSeq + "order by SEQ DESC")
PollerResults myResult = currentFacade.checkServerModel();
currentFacade.saveResults(myResult);
}
}
/*function doPoll(){
$.post('ajax/test.html', function(data) {
alert(data); // process results here
setTimeout(doPoll,5000);
});
}
while(true){
fullPoll();
Thread.sleep(10000);
}
*/