Revision 46729
Added by Michele Artini about 7 years ago
DefaultServiceClientFactory.java | ||
---|---|---|
61 | 61 |
|
62 | 62 |
@Override |
63 | 63 |
public <T extends BaseServiceClient> T getClient(final Class<T> clazz, final Comparator<ServiceRunningInstance> comparator) { |
64 |
if (!getClass().isAnnotationPresent(DnetServiceClient.class)) { throw new DnetGenericRuntimeException(
|
|
65 |
"A required annotation is missing (@DnetServiceClient) in class " + getClass()); }
|
|
64 |
if (!clazz.isAnnotationPresent(DnetServiceClient.class)) { throw new DnetGenericRuntimeException(
|
|
65 |
"A required annotation is missing (@DnetServiceClient) in class " + clazz); }
|
|
66 | 66 |
|
67 |
final DnetServiceType type = getClass().getAnnotation(DnetServiceClient.class).value();
|
|
67 |
final DnetServiceType type = clazz.getAnnotation(DnetServiceClient.class).value();
|
|
68 | 68 |
|
69 | 69 |
log.debug("searching for service: " + type); |
70 | 70 |
|
71 |
final String xquery = "for $x in collection('/db/DRIVER/dnetService/" + type + ") return $x//RESOURCE_URI/@value/string()"; |
|
71 |
final String xquery = "for $x in collection('/db/DRIVER/dnetService/" + type + "') return $x//RESOURCE_URI/@value/string()";
|
|
72 | 72 |
|
73 | 73 |
try { |
74 | 74 |
final Optional<ServiceRunningInstance> instance = isClient.find(xquery) |
Also available in: Unified diff
async methods