Interface InstanceTypeService


  • @ProviderType
    public interface InstanceTypeService
    Allows to detect if the current AEM instance is an author or publish instance.

    This service does not rely in SlingSettingServices which is deprecated and subject to removal in latest AEM versions. Instead, it is based on a OSGi configuration which should be configured properly for author and publish instances. If not configured, it "guesses" the instance type from other OSGi configs and writes a warning in the logs.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NotNull java.util.Set<java.lang.String> getRunModes()
      Returns a set with a single "author" or "publish" run mode string.
      boolean isAuthor()
      Returns true if code is running on AEM author instance.
      boolean isPublish()
      Returns true if code is running on AEM publish instance.
    • Method Detail

      • isAuthor

        boolean isAuthor()
        Returns true if code is running on AEM author instance.
        Returns:
        true if AEM author instance.
      • isPublish

        boolean isPublish()
        Returns true if code is running on AEM publish instance.
        Returns:
        true if AEM publish instance.
      • getRunModes

        @NotNull
        @NotNull java.util.Set<java.lang.String> getRunModes()
        Returns a set with a single "author" or "publish" run mode string. This method is provided for for compatibility with code relying on sets of run modes formerly provided by SlingSettingsService.
        Returns:
        Set with a single element: Either "author" or "publish".