Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Unable to fetch OSGi Configuration Values

vdhim23
Level 5
Level 5

Hi,

I have created an event handler and used OSGi configuration as below.

@Component(immediate = true,
  service=EventHandler.class,
  property= {
  EventConstants.EVENT_TOPIC + "=" + ReplicationAction.EVENT_TOPIC
  }
)
  @Designate(ocd = PagePublishEventHandler.Configuration.class)
  public class PagePublishEventHandler implements EventHandler {

  private static String rootPage = "";
  @Override
  public void handleEvent(final Event event) {

  }

  @Activate
  @Modified
  public void activate(Configuration config) {
  String rootPage = config.getPath();
  logger.info("********ConfigurationPropertyInterface**********activate**********************");
  logger.info("********rootPage********",rootPage); 
  }

  @ObjectClassDefinition(name="AEM Plugin OSGi Configuration")
  public @interface Configuration {
  @AttributeDefinition(
  name = "Root Page For Web Site",
  description = "Configurable paths for root page",
  type = AttributeType.STRING
  )
  String getPath() default "/content";
  }

  }

Any Idea why I am not able to get path. AEM version 6.5

Thanks

0 Replies