01: package de.schlund.pfixcore.webservice;
02:
03: import de.schlund.pfixxml.perflogging.PerfEvent;
04: import de.schlund.pfixxml.perflogging.PerfEventType;
05:
06: public class ProcessingInfo {
07:
08: String service;
09: String method;
10: long startTime;
11:
12: long invocTime = -1;
13: PerfEvent invocEvent;
14:
15: long procTime = -1;
16: PerfEvent procEvent;
17:
18: public ProcessingInfo(String service, String method) {
19: this .service = service;
20: this .method = method;
21: }
22:
23: public void setService(String service) {
24: this .service = service;
25: }
26:
27: public String getService() {
28: return service;
29: }
30:
31: public void setMethod(String method) {
32: this .method = method;
33: }
34:
35: public String getMethod() {
36: return method;
37: }
38:
39: public void setStartTime(long startTime) {
40: this .startTime = startTime;
41: }
42:
43: public long getStartTime() {
44: return startTime;
45: }
46:
47: public void startInvocation() {
48: invocEvent = new PerfEvent(PerfEventType.WEBSERVICE_INVOCATION);
49: invocEvent.setIdentfier(service + "." + method);
50: invocEvent.start();
51: invocTime = System.currentTimeMillis();
52: }
53:
54: public void endInvocation() {
55: invocEvent.save();
56: invocTime = System.currentTimeMillis() - invocTime;
57: }
58:
59: public long getInvocationTime() {
60: return invocTime;
61: }
62:
63: public void startProcessing() {
64: procEvent = new PerfEvent(PerfEventType.WEBSERVICE_PROCESSING);
65: procEvent.setIdentfier(service + "." + method);
66: procEvent.start();
67: procTime = System.currentTimeMillis();
68: }
69:
70: public void endProcessing() {
71: procEvent.save();
72: procTime = System.currentTimeMillis() - procTime;
73: }
74:
75: public long getProcessingTime() {
76: return procTime;
77: }
78:
79: }
|