Class ExtensionItemInfoImpl

All Implemented Interfaces:
ClassItemInfo, ExtensionItemInfo, ItemInfo, DisableSupport, ScanSupport

public class ExtensionItemInfoImpl extends ClassItemInfoImpl implements ExtensionItemInfo
Extension item info implementation.
Since:
06.07.2016
  • Constructor Details

    • ExtensionItemInfoImpl

      public ExtensionItemInfoImpl(Class<?> type)
      Create item.
      Parameters:
      type - extension type
  • Method Details

    • getDisabledBy

      public Set<ItemId> getDisabledBy()
      Description copied from interface: DisableSupport
      Item may be disabled either from root application class or from GuiceyBundle. For application, Application class stored as context and for guicey bundle actual bundle instance id is stored.
      Specified by:
      getDisabledBy in interface DisableSupport
      Returns:
      contexts where item was disabled or empty collection
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: DisableSupport
      Item is enabled if no one disable it (DisableSupport.getDisabledBy() is empty).
      Specified by:
      isEnabled in interface DisableSupport
      Returns:
      true if item enabled, false otherwise
    • getInstalledBy

      public Class<? extends FeatureInstaller> getInstalledBy()
      Description copied from interface: ExtensionItemInfo
      Each extension is always registered by single installer. If extension is recognizable by multiple installers then it will be installed by first matching installer.
      Specified by:
      getInstalledBy in interface ExtensionItemInfo
      Returns:
      installer installed this extension
    • isFromScan

      public boolean isFromScan()
      Specified by:
      isFromScan in interface ScanSupport
      Returns:
      true if item found by classpath scan, false otherwise
    • isLazy

      public boolean isLazy()
      Description copied from interface: ExtensionItemInfo
      Lazy beans are not registered in guice by default. Some installers could support this flag in a special way.
      Specified by:
      isLazy in interface ExtensionItemInfo
      Returns:
      true if extension annotated with LazyBinding, false otherwise
    • isJerseyManaged

      public boolean isJerseyManaged()
      Description copied from interface: ExtensionItemInfo
      Indicates extension management by jersey instead of guice.

      Soft deprecation: try to avoid hk2 direct usage if possible, someday HK2 support will be removed

      Specified by:
      isJerseyManaged in interface ExtensionItemInfo
      Returns:
      true if extension annotated with JerseyManaged, false otherwise
    • isGuiceBinding

      public boolean isGuiceBinding()
      Description copied from interface: ExtensionItemInfo
      Indicates extensions, recognized from guice modules. Extension might be found both by classpath scan (or registered manually) and be detected as binding declaration and in this case no automatic guice binding would be performed.
      Specified by:
      isGuiceBinding in interface ExtensionItemInfo
      Returns:
      true if extension detected in guice bindings, false otherwise (for direct-only extension)
    • isOptional

      public boolean isOptional()
      Description copied from interface: ExtensionItemInfo
      Optional extensions are registered directly in guicey bundles. These extensions automatically become disabled if no installer recognize it (instead of throwing exception).
      Specified by:
      isOptional in interface ExtensionItemInfo
      Returns:
      true if extension is optional
    • setLazy

      public void setLazy(boolean lazy)
      Parameters:
      lazy - lazy extension
    • setJerseyManaged

      public void setJerseyManaged(boolean jerseyManaged)
      Parameters:
      jerseyManaged - jersey managed extension
    • setManualBinding

      public void setManualBinding(com.google.inject.Binding manualBinding)
      Parameters:
      manualBinding - manually declared guice binding
    • getManualBinding

      public com.google.inject.Binding getManualBinding()
      Returns:
      manually declared guice binding
    • getInstaller

      public FeatureInstaller getInstaller()
      Returns:
      installer recognized extension
    • setInstaller

      public void setInstaller(FeatureInstaller installer)
      Parameters:
      installer - installer recognized extension
    • setOptional

      public void setOptional(boolean optional)
      Parameters:
      optional - optional extension
    • isWebExtension

      public boolean isWebExtension()
      Description copied from interface: ExtensionItemInfo
      Web extensions detected by WebInstaller marker interface on detected installer. Web extensions are: resources, servlets, filters, rest and all related jersey extensions. Everything that is not starts with lightweight guicey test should be marked as web.
      Specified by:
      isWebExtension in interface ExtensionItemInfo
      Returns:
      true if extension is a web extension
    • isJerseyExtension

      public boolean isJerseyExtension()
      Description copied from interface: ExtensionItemInfo
      Jersey extensions detected by JerseyInstaller interface. Note that jersey extensions are ExtensionItemInfo.isWebExtension().

      Don't confuse with ExtensionItemInfo.isJerseyManaged() which indicates what ioc manage extension instance (guice/hk2).

      Specified by:
      isJerseyExtension in interface ExtensionItemInfo
      Returns:
      true if extension is a jersey extension