Highlighted

Unable to fetch OSGi Configuration Values

vdhim23

15-06-2019

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