Project

General

Profile

1
package eu.dnetlib.enabling.hcm.sn;
2

    
3
import java.util.List;
4

    
5
import org.springframework.beans.factory.FactoryBean;
6
import org.springframework.beans.factory.annotation.Autowired;
7

    
8
import eu.dnetlib.enabling.actions.SubscriptionAction;
9

    
10
/**
11
 * This class acts as a simple registry of msro subscription actions.
12
 * 
13
 * <p>
14
 * Subscription actions are autodetected using spring autowiring from the current application context and are available for the manager for
15
 * handling subscriptions and delivering notification to particular code interested in those notifications.
16
 * </p>
17
 * 
18
 * @author marko
19
 * 
20
 */
21
@SuppressWarnings("rawtypes")
22
public class HCMSubscriptionListFactory implements FactoryBean {
23

    
24
	/**
25
	 * actions. Spring injects all the declared SubscriptionActions here.
26
	 */
27
	@Autowired(required = false)
28
	private List<SubscriptionAction> actions;
29

    
30
	public List<SubscriptionAction> getActions() {
31
		return actions;
32
	}
33

    
34
	public void setActions(final List<SubscriptionAction> actions) {
35
		this.actions = actions;
36
	}
37

    
38
	/**
39
	 * {@inheritDoc}
40
	 * 
41
	 * @see org.springframework.beans.factory.FactoryBean#getObject()
42
	 */
43
	@Override
44
	public Object getObject() {
45
		return getActions();
46
	}
47

    
48
	@Override
49
	public Class<?> getObjectType() {
50
		return null;
51
	}
52

    
53
	@Override
54
	public boolean isSingleton() {
55
		return false;
56
	}
57
}
(3-3/3)