Which is avalid way of creating an OSGI service?
Which is avalid way of creating an OSGI service?
The valid way of creating an OSGI service is to use both the @Component and @Service annotations. This approach correctly defines the class as a component and service in the OSGI framework, which the other options do not. The correct implementation should involve the OSGI annotations, ensuring that the class, MyServiceImpl, is properly recognized and registered as a service.
Ans is C
C. ©Component ©Service class MyServiceImpl extends MyService the new way is @compone(service="myService") public class MyServiceImpll implements MyService {}
C. ©Component ©Service class MyServiceImpl extends MyService the new way is @compone(service=MyService.class) public class MyServiceImpll implements MyService {}