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

    Modifier and Type
    Method
    Description
    @NotNull Set<String>
    Returns a set with a single "author" or "publish" run mode string.
    boolean
    Returns true if code is running on AEM author instance.
    boolean
    Returns true if code is running on AEM publish instance.
  • Method Details

    • 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 Set<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".