Revision 47406
Added by Antonis Lempesis almost 7 years ago
CompatibilityServiceLocator.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.clients.utils.ws; |
2 | 2 |
|
3 |
import eu.dnetlib.common.rmi.BaseService; |
|
4 |
import eu.dnetlib.enabling.is.store.rmi.ISStoreService; |
|
5 |
import eu.dnetlib.enabling.locators.UniqueServiceLocator; |
|
6 |
import eu.dnetlib.utils.resolver.TransportConfiguration; |
|
3 | 7 |
import org.apache.log4j.Logger; |
4 | 8 |
|
5 | 9 |
import eu.dnetlib.api.DriverService; |
... | ... | |
23 | 27 |
public class CompatibilityServiceLocator<S extends DriverService> implements |
24 | 28 |
ServiceLocator<S> { |
25 | 29 |
|
26 |
private static Logger logger = Logger |
|
27 |
.getLogger(CompatibilityServiceLocator.class); |
|
30 |
private static Logger logger = Logger.getLogger(CompatibilityServiceLocator.class); |
|
28 | 31 |
|
29 |
/** |
|
30 |
* The CNR service locator. It is not bounded because the endpoints do not |
|
31 |
* follow the DriverWebService hierarchy. |
|
32 |
*/ |
|
33 |
private eu.dnetlib.enabling.tools.ServiceLocator<?> serviceLocator = null; |
|
32 |
private UniqueServiceLocator serviceLocator; |
|
34 | 33 |
|
35 | 34 |
/** The service class */ |
36 | 35 |
private Class<S> serviceClass = null; |
37 | 36 |
|
37 |
TransportConfiguration transportConfiguration = null; |
|
38 |
|
|
38 | 39 |
/** The factory used to create service clients */ |
39 | 40 |
private ServiceClientFactory<S> clientFactory = null; |
40 | 41 |
|
... | ... | |
45 | 46 |
S service = null; |
46 | 47 |
|
47 | 48 |
try { |
48 |
Object endpoint = serviceLocator.getService();
|
|
49 |
Class<? extends BaseService> endpointClass = (Class<? extends BaseService>) transportConfiguration.getEndpointClass(serviceClass);
|
|
49 | 50 |
|
51 |
Object endpoint = serviceLocator.getService(ISStoreService.class); |
|
52 |
|
|
50 | 53 |
logger.debug("Found service endpoint of type: " |
51 | 54 |
+ endpoint.getClass().getName()); |
52 | 55 |
|
... | ... | |
58 | 61 |
return service; |
59 | 62 |
} |
60 | 63 |
|
61 |
public eu.dnetlib.enabling.tools.ServiceLocator<?> getServiceLocator() {
|
|
64 |
public UniqueServiceLocator getServiceLocator() {
|
|
62 | 65 |
return serviceLocator; |
63 | 66 |
} |
64 | 67 |
|
65 |
public void setServiceLocator( |
|
66 |
eu.dnetlib.enabling.tools.ServiceLocator<?> serviceLocator) { |
|
68 |
public void setServiceLocator(UniqueServiceLocator serviceLocator) { |
|
67 | 69 |
this.serviceLocator = serviceLocator; |
68 | 70 |
} |
69 | 71 |
|
Also available in: Unified diff
moved to dnet45