Project

General

Profile

« Previous | Next » 

Revision 32526

cnr-notifications-common >= 2.0.0

View differences:

HCMSubscriberImpl.java
14 14
import eu.dnetlib.enabling.actions.SubscriptionAction;
15 15
import eu.dnetlib.enabling.is.sn.rmi.ISSNException;
16 16
import eu.dnetlib.enabling.is.sn.rmi.ISSNService;
17
import eu.dnetlib.enabling.tools.ServiceLocator;
17
import eu.dnetlib.enabling.locators.UniqueServiceLocator;
18 18
import eu.dnetlib.soap.EndpointReferenceBuilder;
19 19

  
20 20
/**
21
 * This component takes care of subscribing the SubscriptionAction(s) to
22
 * interesting events.
23
 *
21
 * This component takes care of subscribing the SubscriptionAction(s) to interesting events.
22
 * 
24 23
 * @author claudio
25
 *
24
 * 
26 25
 */
27 26
public class HCMSubscriberImpl implements HCMSubscriber {
28 27

  
29 28
	/**
30 29
	 * logger.
31 30
	 */
32
	private static final Log log = LogFactory.getLog(HCMSubscriberImpl.class); // NOPMD
33
																				// by
34
																				// marko
35
																				// on
36
																				// 11/24/08
37
																				// 5:02
38
																				// PM
31
	private static final Log log = LogFactory.getLog(HCMSubscriberImpl.class);
39 32

  
40 33
	/**
41 34
	 * notification endpoint (normally the msro service).
......
43 36
	private Endpoint endpoint;
44 37

  
45 38
	/**
46
	 * is sn locator.
39
	 * service locator.
47 40
	 */
48
	private ServiceLocator<ISSNService> snLocator;
41
	private UniqueServiceLocator serviceLocator;
49 42

  
50 43
	/**
51 44
	 * injected EPR builder.
......
65 58

  
66 59
	/**
67 60
	 * {@inheritDoc}
68
	 *
61
	 * 
69 62
	 * @throws ISSNException
70 63
	 *             could happen
71 64
	 * @see eu.dnetlib.enabling.hcm.sn.HCMSubscriber#subscribeAll()
......
80 73
			for (final SubscriptionAction action : getActions()) {
81 74
				log.info("dynamically subscribing to "
82 75
						+ action.getTopicExpression());
83
				snLocator.getService().subscribe(endpointReference,
76
				serviceLocator.getService(ISSNService.class, true).subscribe(endpointReference,
84 77
						action.getTopicExpression(), 0);
85 78
			}
86 79
		}
......
103 96
		return eprBuilder;
104 97
	}
105 98

  
106
	public ServiceLocator<ISSNService> getSnLocator() {
107
		return snLocator;
108
	}
109

  
110
	public void setSnLocator(final ServiceLocator<ISSNService> snLocator) {
111
		this.snLocator = snLocator;
112
	}
113

  
114 99
	public List<SubscriptionAction> getActions() {
115 100
		return actions;
116 101
	}
......
120 105
		this.actions = actions;
121 106
	}
122 107

  
108
	public UniqueServiceLocator getServiceLocator() {
109
		return serviceLocator;
110
	}
111

  
112
	@Required
113
	public void setServiceLocator(final UniqueServiceLocator serviceLocator) {
114
		this.serviceLocator = serviceLocator;
115
	}
116

  
123 117
}

Also available in: Unified diff