org.apache.felix.scr dependency in AEM 6.2 / 6.3 | Community
Skip to main content
Level 5
December 27, 2017
Solved

org.apache.felix.scr dependency in AEM 6.2 / 6.3

  • December 27, 2017
  • 7 replies
  • 3510 views

I noticed that org.apache.felix.scr is exported by one of the bundles in AEM
6.0 but not in AEM 6.3. There seems to be a bundle by name of org.apache.felix.scr in 6.3 also but it doesn't export the same package.

Is this expected? Or this is a bug with my copy of 6.3?

Should the org.apache.felix.scr jar be installed as an external dependency in 6.3 if it's being used by any custom bundle?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

Hi,

Apologies re-looked at your question, have a look at:ServiceComponentRuntime (http://javadox.com/org.osgi/osgi.cmpn/6.0.0/org/osgi/service/component/runtime/ServiceComponentRuntime.html )

It can do following things:

final Collection<ComponentDescriptionDTO> descs = scrService.getComponentDescriptionDTOs(bundle);

for(final ComponentDescriptionDTO d : descs)

{

   if ( !scrService.isComponentEnabled(d))

  {

  disabled.add(d);

  }

   else
   {

   final Collection<ComponentConfigurationDTO> configs = scrService.getComponentConfigurationDTOs(d);

   if ( configs.isEmpty() )

  {

  disabled.add(d);

  }

   else
   {

  configurations.addAll(configs);

  }

  }

}

org/apache/felix/webconsole/plugins/ds/internal/InfoProvider.java:89

Regards,

Peter

7 replies

Level 5
January 1, 2018

Hello..any help on this?

Peter_Puzanovs
Community Advisor
Community Advisor
January 1, 2018

Hey Jake,

Happy New Year!

For 6.3 you should be moving to the OSGi Service annotations.

Official OSGi Declarative Services Annotations in AEM - Adobe Experience Manager | AEM/CQ | Apache Sling

SCR is still there, but it's merely used for bundles that are not yet migrated to the OSGi annotations for your own code OSGi annotations should be the way forward.

Thanks,

Peter

Level 5
January 1, 2018

Thanks Peter.

I wasn't talking about the annotations but classes like org.apache.felix.scr.ScrService and org.apache.felix.scr.Component which do not appear to be present in 6.2 and 6.3 in the org.apache.felix.scr bundle.

Any way around this?

I'm using these classes to get the state of a Component (active / inactive).

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
January 2, 2018

Hi,

Apologies re-looked at your question, have a look at:ServiceComponentRuntime (http://javadox.com/org.osgi/osgi.cmpn/6.0.0/org/osgi/service/component/runtime/ServiceComponentRuntime.html )

It can do following things:

final Collection<ComponentDescriptionDTO> descs = scrService.getComponentDescriptionDTOs(bundle);

for(final ComponentDescriptionDTO d : descs)

{

   if ( !scrService.isComponentEnabled(d))

  {

  disabled.add(d);

  }

   else
   {

   final Collection<ComponentConfigurationDTO> configs = scrService.getComponentConfigurationDTOs(d);

   if ( configs.isEmpty() )

  {

  disabled.add(d);

  }

   else
   {

  configurations.addAll(configs);

  }

  }

}

org/apache/felix/webconsole/plugins/ds/internal/InfoProvider.java:89

Regards,

Peter

Peter_Puzanovs
Community Advisor
Community Advisor
January 2, 2018
smacdonald2008
Level 10
January 2, 2018

Thank you for posting a detail response Peter!

Level 5
January 2, 2018

This is really great. Thanks a lot.