A client has a requirement to get the location of stores based on the zip code authored in the component dialog. Location needs to be pulled from an external API using OSGi services.
Which OSGi Service code snippet should be used to represent the requirement?
A)
@OSGIService(component = Service.class)
public class ServiceImpl implements Service {
@Override
public List
List
// Create an HTTP client
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
// Processing logic to get all the locations from external api
} catch (IOException e) {
}
return storeLocations;
}
}
B)
@Component(service = Service.class)
public class ServiceImpl implements Service {
@Override
public List
List
// Create an HTTP client
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
// Processing logic to get all the locations from external api
} catch (IOException e) {
}
return storeLocations;
}
}
C)
@Service(service = Component.class)
public class ServiceImpl implements Service {
@Override
public List
List
// Create an HTTP client
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
// Processing logic to get all the locations from external api
} catch (IOException e) {
}
return storeLocations;
}
}
Lashandra
2 days agoLemuel
21 days agoFelix
26 days agoLashandra
1 month agoLemuel
1 month agoLashandra
1 month agoFelix
2 months agoLemuel
2 months agoTwila
2 months agoLeanora
2 months agoRasheeda
2 months agoNoe
2 months agoCrista
3 months agoFelix
3 months agoGianna
3 months agoClaribel
3 months agoIrma
3 months agoAlease
4 months agoCornell
4 months agoWillodean
4 months agoSelma
4 months agoLazaro
4 months agoShakira
5 months agoElly
5 months agoMona
5 months agoLashon
5 months agoLaine
5 months ago