Skip to main content

Posts

Showing posts with the label AEM

OSGI

 OSGI Annotation Mapping to OSGi Declarative Services Annotations The below table gives you an overview of how to map the annotations. Annotation Mapping APACHE FELIX SCR ANNOTATION DESCRIPTION OSGI DECLARATIVE SERVICES ANNOTATION DESCRIPTION @Component The @Component annotation marks a Java class to be used as a component. @Component This is more or less a strict one-to-one replacement. Only difference is the default behavior for services. See below. @Service Marks the component as a service and optionally lists the provided services (classes) @Component The OSGi annotation has a service attribute which should be used to list the provided services. Be careful, if your component should not provide any service, set this attribute to an empty array. @Reference Reference to services, can be used on unary fields or on class level with bind/unbind methods. @Reference Field references can directly be migrated, for event based references (methods), the @Reference annotation must be p...