Restoring Usage Event Listener until proper patch is prepared

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6132 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2011-03-09 22:32:42 +00:00
parent b821d47d7c
commit 02971f769c

View File

@@ -0,0 +1,54 @@
/**
* The contents of this file are subject to the license and copyright
* detailed in the LICENSE and NOTICE files at the root of the source
* tree and available online at
*
* http://www.dspace.org/license/
*/
package org.dspace.usage;
import org.dspace.services.EventService;
import org.dspace.services.model.EventListener;
/**
* AbstractUsageEventListener is used as the base class for listening events running
* in the EventService.
*
* @author Mark Diggory (mdiggory at atmire.com)
* @version $Revision: $
*/
public abstract class AbstractUsageEventListener implements EventListener {
public AbstractUsageEventListener() {
super();
}
/**
* Empty String[] flags to have Listener
* consume any event name prefixes.
*/
public String[] getEventNamePrefixes() {
return new String[0];
}
/**
* Currently consumes events generated for
* all resources.
*/
public String getResourcePrefix() {
return null;
}
public void setEventService(EventService service) {
if(service != null)
{
service.registerEventListener(this);
}
else
{
throw new IllegalStateException("EventService handed to Listener cannot be null");
}
}
}