1 package eu
.etaxonomy
.cdm
.api
.cache
;
5 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
6 import org
.springframework
.stereotype
.Component
;
8 import eu
.etaxonomy
.cdm
.api
.service
.ITermService
;
9 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
10 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
11 import eu
.etaxonomy
.taxeditor
.remoting
.cache
.CacheLoader
;
12 import eu
.etaxonomy
.taxeditor
.remoting
.cache
.CdmTransientEntityCacher
;
15 * Class which uses CDM services to cache cdm entities
17 * FIXME: Currently only handles terms entities. It would be
18 * interesting to have a generic method which finds the
19 * correct service to load / cache the entity.
26 public class CdmServiceCacher
extends CdmCacher
{
29 ITermService termService
;
31 private CacheLoader cacheLoader
;
34 protected void setup() {
35 DefinedTermBase
.setCacher(this);
36 CdmTransientEntityCacher
.setDefaultCacher(this);
37 cacheLoader
= new CacheLoader(this);
41 protected CdmBase
findByUuid(UUID uuid
) {
42 CdmBase term
= termService
.findWithoutFlush(uuid
);
43 return cacheLoader
.load(term
, true);