Revision e1dddccc
Added by Andreas Müller over 1 year ago
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/cache/CdmServiceCacher.java | ||
---|---|---|
163 | 163 |
T cachedCdmEntity = (T)getFromCache(cdmEntity.getUuid()); |
164 | 164 |
|
165 | 165 |
if(isCachable(cdmEntity) && cachedCdmEntity == null) { |
166 |
cachedCdmEntity = cacheLoader.load(cdmEntity, false, true);
|
|
166 |
cachedCdmEntity = cacheLoader.load(cdmEntity, false, true); |
|
167 | 167 |
} |
168 | 168 |
return cachedCdmEntity; |
169 | 169 |
} |
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/cdm/api/lazyloading/CdmLazyLoader.java | ||
---|---|---|
94 | 94 |
|
95 | 95 |
/** |
96 | 96 |
* 'Around' advice for the initialization of Collection objects |
97 |
* |
|
98 | 97 |
*/ |
99 | 98 |
@Around(value = "possibleCollectionLazyInitializationException()") |
100 | 99 |
public Object preloadCollectionOnDemand(ProceedingJoinPoint pjp) throws Throwable { |
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/TimestampingHttpInvokerRequestExecutor.java | ||
---|---|---|
66 | 66 |
|
67 | 67 |
setExecutionRequestClientTimestamp(httpPost.getURI()); |
68 | 68 |
|
69 |
HttpResponse respone = super.executeHttpPost(config, httpClient, httpPost); |
|
69 |
HttpResponse response = super.executeHttpPost(config, httpClient, httpPost);
|
|
70 | 70 |
|
71 |
setExecutionResponseHttpHeaderTimestamp(respone); |
|
71 |
setExecutionResponseHttpHeaderTimestamp(response);
|
|
72 | 72 |
|
73 |
return respone; |
|
73 |
return response;
|
|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
private void setExecutionRequestClientTimestamp(URI requestURI){ |
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionManager.java | ||
---|---|---|
112 | 112 |
|
113 | 113 |
@Override |
114 | 114 |
public <T extends Object> T load(T obj, boolean update) { |
115 |
if(tlActiveSession.get() == null) { |
|
115 |
ICdmEntitySession session = tlActiveSession.get(); |
|
116 |
if(session == null) { |
|
116 | 117 |
return obj; |
117 | 118 |
} else { |
118 |
return tlActiveSession.get().load(obj, update);
|
|
119 |
return session.load(obj, update);
|
|
119 | 120 |
} |
120 | 121 |
} |
121 | 122 |
|
eu.etaxonomy.taxeditor.cdmlib/src/main/java/org/springframework/remoting/httpinvoker/CachingHttpInvokerProxyFactoryBean.java | ||
---|---|---|
98 | 98 |
//Note AM (2022-06-15): the debug information seem to be misleading (also because cache() is not used/implemented anymore) |
99 | 99 |
if(persistingMethods.contains(invocation.getMethodName())) { |
100 | 100 |
invocationResult = new RemoteInvocationResult(cdmEntitySessionManager().load(invocationResult.getValue(), true)); |
101 |
logger.debug("Entity cached with updating cached data");
|
|
101 |
if (logger.isDebugEnabled()){logger.debug("Entity cached with updating cached data");}
|
|
102 | 102 |
} else if(invocationResult.getValue() instanceof UpdateResult){ |
103 | 103 |
UpdateResult result = (UpdateResult)invocationResult.getValue(); |
104 | 104 |
if(result.isOk()){ |
105 |
logger.debug("Entity from UpdateResult stored in cache with updating cached data" );
|
|
105 |
if (logger.isDebugEnabled()){logger.debug("Entity from UpdateResult stored in cache with updating cached data" );}
|
|
106 | 106 |
try { |
107 | 107 |
cdmEntitySessionManager().load(result, true); |
108 | 108 |
} catch (Exception e) { |
... | ... | |
112 | 112 |
} |
113 | 113 |
} else { |
114 | 114 |
invocationResult = new RemoteInvocationResult(cdmEntitySessionManager().load(invocationResult.getValue(), false)); |
115 |
logger.debug("Entity cached without updating cached data" );
|
|
115 |
if (logger.isDebugEnabled()){logger.debug("Entity cached without updating cached data" );}
|
|
116 | 116 |
} |
117 | 117 |
} |
118 | 118 |
cache(invocation, invocationResult); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/supplementaldata/SupplementalDataPartE4.java | ||
---|---|---|
64 | 64 |
|
65 | 65 |
@Override |
66 | 66 |
public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) { |
67 |
if(activePart==thisPart){
|
|
67 |
if(activePart == thisPart){
|
|
68 | 68 |
return; |
69 | 69 |
} |
70 | 70 |
// setEnabled(true); |
... | ... | |
74 | 74 |
setEnabled(true); |
75 | 75 |
|
76 | 76 |
IStructuredSelection structuredSelection = createSelection(selection); |
77 |
if(structuredSelection==null || structuredSelection.isEmpty()){
|
|
77 |
if(structuredSelection == null || structuredSelection.isEmpty()){
|
|
78 | 78 |
showEmptyPage(); |
79 | 79 |
return; |
80 | 80 |
} |
... | ... | |
139 | 139 |
return; |
140 | 140 |
} |
141 | 141 |
|
142 |
|
|
143 | 142 |
if(!(structuredSelection.getFirstElement() instanceof ICdmBase)){ |
144 | 143 |
showEmptyPage(); |
145 | 144 |
return; |
... | ... | |
155 | 154 |
} |
156 | 155 |
} |
157 | 156 |
|
157 |
private void initialize(ICdmBase cdmBase) { |
|
158 |
if (cdmBase.isInstanceOf(AnnotatableEntity.class)){ |
|
159 |
AnnotatableEntity entity = CdmBase.deproxy(cdmBase, AnnotatableEntity.class); |
|
160 |
// CdmStore.getCommonService().initializeSupplementalData(entity); |
|
161 |
} |
|
162 |
} |
|
163 |
|
|
158 | 164 |
@Override |
159 | 165 |
protected void showEmptyPage() { |
160 | 166 |
super.showEmptyPage(); |
161 |
if(viewer!=null && viewer.getControl()!=null && !viewer.getControl().isDisposed()){
|
|
167 |
if(viewer != null && viewer.getControl() !=null && !viewer.getControl().isDisposed()){
|
|
162 | 168 |
try{ |
163 | 169 |
viewer.destroySections(); |
164 | 170 |
}catch (SWTException e){ |
Also available in: Unified diff
cleanup