Revision 89374cca
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/remoting/RemoteExecutionTimestampsUtil.java | ||
---|---|---|
9 | 9 |
package eu.etaxonomy.taxeditor.remoting; |
10 | 10 |
|
11 | 11 |
/** |
12 |
* Singleton/static class to log the last httpInvoker |
|
13 |
* request and response metadata. |
|
14 |
* This is currently static to be easily accessible by MessagingUtils. |
|
15 |
* |
|
16 |
* Note: does not work clean in a multi-thread environment yet. |
|
17 |
* |
|
12 | 18 |
* @author a.kohlbecker |
13 | 19 |
* @since Jan 17, 2020 |
14 | 20 |
*/ |
15 | 21 |
public class RemoteExecutionTimestampsUtil { |
16 | 22 |
|
17 |
protected static String lastRequestClientTime = null;
|
|
23 |
private static String lastRequestClientTime = null;
|
|
18 | 24 |
|
19 |
protected static String lastResponseHeaderTime = null;
|
|
25 |
private static String lastResponseHeaderTime = null;
|
|
20 | 26 |
|
21 | 27 |
protected static String lastServiceMethod = null; |
22 | 28 |
|
23 |
public RemoteExecutionTimestampsUtil() { |
|
24 | 29 |
|
30 |
public RemoteExecutionTimestampsUtil() { |
|
25 | 31 |
} |
26 | 32 |
|
27 | 33 |
static public String getLastRequestClientTime() { |
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/springframework/remoting/httpinvoker/CachingHttpInvokerProxyFactoryBean.java | ||
---|---|---|
17 | 17 |
import org.aopalliance.intercept.MethodInvocation; |
18 | 18 |
import org.apache.logging.log4j.LogManager; |
19 | 19 |
import org.apache.logging.log4j.Logger; |
20 |
|
|
21 | 20 |
import org.springframework.remoting.support.RemoteInvocation; |
22 | 21 |
import org.springframework.remoting.support.RemoteInvocationResult; |
23 | 22 |
|
24 |
import eu.etaxonomy.cdm.api.application.CdmApplicationRemoteController; |
|
25 | 23 |
import eu.etaxonomy.cdm.api.application.CdmApplicationState; |
26 | 24 |
import eu.etaxonomy.cdm.api.service.ITermService; |
27 | 25 |
import eu.etaxonomy.cdm.api.service.UpdateResult; |
... | ... | |
79 | 77 |
} |
80 | 78 |
|
81 | 79 |
// A) if this is a term service call for term lists try to get the terms from the cache |
82 |
|
|
83 |
|
|
80 |
|
|
81 |
|
|
84 | 82 |
if(ITermService.class.isAssignableFrom(this.getServiceInterface())){ |
85 | 83 |
return handleTermRequest(invocation, originalInvocation); |
86 | 84 |
} |
... | ... | |
160 | 158 |
RemoteInvocationResult result = super.executeRequest(invocation, originalInvocation); |
161 | 159 |
if(measureDuration){ |
162 | 160 |
double duration = System.currentTimeMillis() - startTime; |
163 |
|
|
161 |
|
|
164 | 162 |
LocalDateTime date = LocalDateTime.now(); |
165 | 163 |
String dateTimeStr = date.format(DateTimeFormatter.ISO_DATE_TIME); |
166 | 164 |
System.out.println(dateTimeStr + ": "+ getServiceUrl() + "#" + invocation.getMethodName() + " [" + duration + " ms]"); |
... | ... | |
186 | 184 |
private ICdmEntitySessionManager cdmEntitySessionManager(){ |
187 | 185 |
if(cdmEntitySessionManager == null) { |
188 | 186 |
cdmEntitySessionManager = |
189 |
((CdmApplicationRemoteController)CdmApplicationState.getCurrentAppConfig()).getCdmEntitySessionManager();
|
|
187 |
CdmApplicationState.getCurrentAppConfig().getCdmEntitySessionManager();
|
|
190 | 188 |
} |
191 | 189 |
return cdmEntitySessionManager; |
192 | 190 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/MessagingUtils.java | ||
---|---|---|
8 | 8 |
import java.util.List; |
9 | 9 |
|
10 | 10 |
import org.apache.commons.lang3.exception.ExceptionUtils; |
11 |
import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger; |
|
11 |
import org.apache.logging.log4j.LogManager; |
|
12 |
import org.apache.logging.log4j.Logger; |
|
12 | 13 |
import org.eclipse.core.runtime.IStatus; |
13 | 14 |
import org.eclipse.core.runtime.MultiStatus; |
14 | 15 |
import org.eclipse.core.runtime.Platform; |
Also available in: Unified diff
cleanup