Lines 18-23
Link Here
|
18 |
package org.netbeans.modules.web.monitor.client; |
18 |
package org.netbeans.modules.web.monitor.client; |
19 |
|
19 |
|
20 |
import java.util.Comparator; |
20 |
import java.util.Comparator; |
|
|
21 |
import java.util.Date; |
21 |
import java.util.Enumeration; |
22 |
import java.util.Enumeration; |
22 |
import java.util.Hashtable; |
23 |
import java.util.Hashtable; |
23 |
import java.util.Vector; |
24 |
import java.util.Vector; |
Lines 102-109
Link Here
|
102 |
private boolean useBrowserCookie = true; |
103 |
private boolean useBrowserCookie = true; |
103 |
|
104 |
|
104 |
private static Controller instance = null; |
105 |
private static Controller instance = null; |
|
|
106 |
private Date startDate; |
105 |
|
107 |
|
106 |
private Controller() { |
108 |
private Controller() { |
|
|
109 |
startDate = new Date(); |
107 |
currBeans = new Hashtable(); |
110 |
currBeans = new Hashtable(); |
108 |
saveBeans = new Hashtable(); |
111 |
saveBeans = new Hashtable(); |
109 |
createNodeStructure(); |
112 |
createNodeStructure(); |
Lines 144-161
Link Here
|
144 |
|
147 |
|
145 |
} |
148 |
} |
146 |
|
149 |
|
147 |
static void removeFiles() { |
|
|
148 |
if(instance == null) return; |
149 |
instance.cleanup(); |
150 |
} |
151 |
|
152 |
void cleanup() { |
153 |
deleteDirectory(currDirStr); |
154 |
/* |
155 |
removeBrowserListener(); |
156 |
*/ |
157 |
} |
158 |
|
159 |
/** |
150 |
/** |
160 |
* Adds a transaction to the list of current transactions. |
151 |
* Adds a transaction to the list of current transactions. |
161 |
*/ |
152 |
*/ |
Lines 962-975
Link Here
|
962 |
while(e.hasMoreElements()) { |
953 |
while(e.hasMoreElements()) { |
963 |
|
954 |
|
964 |
fo = (FileObject)e.nextElement(); |
955 |
fo = (FileObject)e.nextElement(); |
965 |
id = fo.getName(); |
956 |
if (fo.lastModified().after(startDate)) { |
966 |
if(debug) |
957 |
id = fo.getName(); |
967 |
log("getting current transaction: " + id); //NOI18N |
958 |
if(debug) |
968 |
|
959 |
log("getting current transaction: " + id); //NOI18N |
969 |
// Retrieve the monitordata |
960 |
|
970 |
md = retrieveMonitorData(id, currDir); |
961 |
// Retrieve the monitordata |
971 |
if (md != null) { |
962 |
md = retrieveMonitorData(id, currDir); |
972 |
nodes.add(createTransactionNode(md, true)); |
963 |
if (md != null) { |
|
|
964 |
nodes.add(createTransactionNode(md, true)); |
965 |
} |
966 |
} |
967 |
else { |
968 |
// delete it |
969 |
final FileObject foToDelete = fo; |
970 |
RequestProcessor.getDefault().post(new Runnable () { |
971 |
public void run() { |
972 |
Thread.yield(); |
973 |
try { |
974 |
foToDelete.delete(); |
975 |
} |
976 |
catch (IOException e) { |
977 |
ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e); |
978 |
} |
979 |
} |
980 |
}); |
973 |
} |
981 |
} |
974 |
} |
982 |
} |
975 |
|
983 |
|