mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
Added component annotations.
Added comment. Fixed import.
This commit is contained in:
@@ -6,13 +6,16 @@
|
||||
* http://www.dspace.org/license/
|
||||
*/
|
||||
package org.dspace.iiif;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Exposes the Spring web application's IIIF cache evict service to the DSpace event consumer.
|
||||
*/
|
||||
@Component
|
||||
public class CacheEvictBeanLocator implements ApplicationContextAware {
|
||||
|
||||
private static ApplicationContext context;
|
||||
|
@@ -9,10 +9,12 @@ package org.dspace.iiif;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Removes items from the iiif manifests cache.
|
||||
*/
|
||||
@Component
|
||||
public class CacheEvictService {
|
||||
|
||||
// The cache that is managed by this service.
|
||||
|
@@ -45,6 +45,7 @@ public class IIIFCacheEventConsumer implements Consumer {
|
||||
|
||||
@Override
|
||||
public void consume(Context ctx, Event event) throws Exception {
|
||||
// The service null when the web application context is not provided (i.e. command line operations).
|
||||
if (cacheEvictService == null) {
|
||||
return;
|
||||
}
|
||||
|
@@ -21,8 +21,6 @@ import org.dspace.app.rest.utils.DSpaceConfigurationInitializer;
|
||||
import org.dspace.app.rest.utils.DSpaceKernelInitializer;
|
||||
import org.dspace.app.sitemap.GenerateSitemaps;
|
||||
import org.dspace.app.util.DSpaceContextListener;
|
||||
import org.dspace.iiif.CacheEvictBeanLocator;
|
||||
import org.dspace.iiif.CacheEvictService;
|
||||
import org.dspace.utils.servlet.DSpaceWebappServletFilter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
Reference in New Issue
Block a user