Project

General

Profile

« Previous | Next » 

Revision 674b745b

Added by Andreas Müller about 1 year ago

ref #10186, ref #9174 add method logging to CachingHttpInvokerProxyFactoryBean

View differences:

eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/RemoteExecutionTimestampsUtil.java
24 24

  
25 25
    private static String lastResponseHeaderTime = null;
26 26

  
27
    protected static String lastServiceMethod = null;
27
    private static String lastService = null;
28

  
29
    private static String lastMethod = null;
28 30

  
29 31

  
30 32
    public RemoteExecutionTimestampsUtil() {
......
46 48
        lastResponseHeaderTime = time;
47 49
    }
48 50

  
49
    static public String getLastServiceMethod() {
50
        return lastServiceMethod;
51
    static public String getLastService() {
52
        return lastService;
53
    }
54

  
55
    static public void setLastService(String lastService) {
56
        RemoteExecutionTimestampsUtil.lastService = lastService;
57
    }
58

  
59
    static public String getLastMethod() {
60
        return lastMethod;
51 61
    }
52 62

  
53
    static public void setLastServiceMethod(String lastMethod) {
54
        lastServiceMethod = lastMethod;
63
    static public void setLastMethod(String lastMethod) {
64
        RemoteExecutionTimestampsUtil.lastMethod = lastMethod;
55 65
    }
56 66
}
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TimestampingHttpInvokerRequestExecutor.java
79 79
        String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
80 80
        RemoteExecutionTimestampsUtil.setLastRequestClientTime(dateTimeStr);
81 81
        if(requestURI != null){
82
            RemoteExecutionTimestampsUtil.setLastServiceMethod(requestURI.toString());
82
            RemoteExecutionTimestampsUtil.setLastService(requestURI.toString());
83 83
        }
84 84
    }
85 85

  
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/springframework/remoting/httpinvoker/CachingHttpInvokerProxyFactoryBean.java
23 23
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
24 24
import eu.etaxonomy.cdm.api.service.ITermService;
25 25
import eu.etaxonomy.cdm.api.service.UpdateResult;
26
import eu.etaxonomy.taxeditor.remoting.RemoteExecutionTimestampsUtil;
26 27
import eu.etaxonomy.taxeditor.service.IRemoteInvocationTermCacher;
27 28
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionManager;
28 29

  
......
155 156
            startTime = System.currentTimeMillis();
156 157
        }
157 158
        try {
159
            //setLastMethod can not be done later as invocation is not avaiable later or super class method are final
160
            RemoteExecutionTimestampsUtil.setLastMethod(invocation.getMethodName());
158 161
            RemoteInvocationResult result = super.executeRequest(invocation, originalInvocation);
159 162
            if(measureDuration){
160 163
                double duration = System.currentTimeMillis() - startTime;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java
204 204
        LocalDateTime date = LocalDateTime.now();
205 205
        String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME);
206 206

  
207
        if(RemoteExecutionTimestampsUtil.getLastServiceMethod() != null){
208
            contextInfo.add("last remote method : " + RemoteExecutionTimestampsUtil.getLastServiceMethod());
207
        if(RemoteExecutionTimestampsUtil.getLastService() != null){
208
            contextInfo.add("last remote service : " + RemoteExecutionTimestampsUtil.getLastService());
209
        }
210
        if(RemoteExecutionTimestampsUtil.getLastMethod() != null){
211
            contextInfo.add("last remote method : " + RemoteExecutionTimestampsUtil.getLastMethod());
209 212
        }
210 213
        if(RemoteExecutionTimestampsUtil.getLastRequestClientTime() != null){
211 214
            contextInfo.add("last remote request client time : " + RemoteExecutionTimestampsUtil.getLastRequestClientTime());

Also available in: Unified diff