Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Unable to fetch OSGi Configuration Values

Avatar

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