Class ExtensionItemInfoImpl
java.lang.Object
ru.vyarus.dropwizard.guice.module.context.info.impl.ItemInfoImpl
ru.vyarus.dropwizard.guice.module.context.info.impl.ClassItemInfoImpl
ru.vyarus.dropwizard.guice.module.context.info.impl.ExtensionItemInfoImpl
- All Implemented Interfaces:
ClassItemInfo,ExtensionItemInfo,ItemInfo,DisableSupport,ScanSupport
Extension item info implementation.
- Since:
- 06.07.2016
-
Field Summary
Fields inherited from class ru.vyarus.dropwizard.guice.module.context.info.impl.ItemInfoImpl
complete -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionItem may be disabled either from root application class or fromGuiceyBundle.Class<? extends FeatureInstaller>Each extension is always registered by single installer.com.google.inject.BindingbooleanItem is enabled if no one disable it (DisableSupport.getDisabledBy()is empty).booleanbooleanIndicates extensions, recognized from guice modules.booleanJersey extensions detected byJerseyInstallerinterface.booleanIndicates extension management by jersey instead of guice.booleanisLazy()Lazy beans are not registered in guice by default.booleanOptional extensions are registered directly in guicey bundles.booleanWeb extensions detected byWebInstallermarker interface on detected installer.voidsetInstaller(FeatureInstaller installer) voidsetJerseyManaged(boolean jerseyManaged) voidsetLazy(boolean lazy) voidsetManualBinding(com.google.inject.Binding manualBinding) voidsetOptional(boolean optional) Methods inherited from class ru.vyarus.dropwizard.guice.module.context.info.impl.ItemInfoImpl
countRegistrationAttempt, getId, getIgnoresByScope, getIgnoresByScope, getItemType, getRegisteredBy, getRegistrationAttempts, getRegistrationScope, getRegistrationScopeType, getType, isAllDataCollected, isRegistered, isRegisteredDirectly, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ru.vyarus.dropwizard.guice.module.context.info.ItemInfo
getId, getIgnoresByScope, getIgnoresByScope, getItemType, getRegisteredBy, getRegistrationAttempts, getRegistrationScope, getRegistrationScopeType, getType, isAllDataCollected, isRegistered, isRegisteredDirectly
-
Constructor Details
-
ExtensionItemInfoImpl
Create item.- Parameters:
type- extension type
-
-
Method Details
-
getDisabledBy
Description copied from interface:DisableSupportItem may be disabled either from root application class or fromGuiceyBundle. For application,Applicationclass stored as context and for guicey bundle actual bundle instance id is stored.- Specified by:
getDisabledByin interfaceDisableSupport- Returns:
- contexts where item was disabled or empty collection
-
isEnabled
public boolean isEnabled()Description copied from interface:DisableSupportItem is enabled if no one disable it (DisableSupport.getDisabledBy()is empty).- Specified by:
isEnabledin interfaceDisableSupport- Returns:
- true if item enabled, false otherwise
-
getInstalledBy
Description copied from interface:ExtensionItemInfoEach 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:
getInstalledByin interfaceExtensionItemInfo- Returns:
- installer installed this extension
-
isFromScan
public boolean isFromScan()- Specified by:
isFromScanin interfaceScanSupport- Returns:
- true if item found by classpath scan, false otherwise
-
isLazy
public boolean isLazy()Description copied from interface:ExtensionItemInfoLazy beans are not registered in guice by default. Some installers could support this flag in a special way.- Specified by:
isLazyin interfaceExtensionItemInfo- Returns:
- true if extension annotated with
LazyBinding, false otherwise
-
isJerseyManaged
public boolean isJerseyManaged()Description copied from interface:ExtensionItemInfoIndicates 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:
isJerseyManagedin interfaceExtensionItemInfo- Returns:
- true if extension annotated with
JerseyManaged, false otherwise
-
isGuiceBinding
public boolean isGuiceBinding()Description copied from interface:ExtensionItemInfoIndicates 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:
isGuiceBindingin interfaceExtensionItemInfo- Returns:
- true if extension detected in guice bindings, false otherwise (for direct-only extension)
-
isOptional
public boolean isOptional()Description copied from interface:ExtensionItemInfoOptional extensions are registered directly in guicey bundles. These extensions automatically become disabled if no installer recognize it (instead of throwing exception).- Specified by:
isOptionalin interfaceExtensionItemInfo- 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
- Returns:
- installer recognized extension
-
setInstaller
- Parameters:
installer- installer recognized extension
-
setOptional
public void setOptional(boolean optional) - Parameters:
optional- optional extension
-
isWebExtension
public boolean isWebExtension()Description copied from interface:ExtensionItemInfoWeb extensions detected byWebInstallermarker 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:
isWebExtensionin interfaceExtensionItemInfo- Returns:
- true if extension is a web extension
-
isJerseyExtension
public boolean isJerseyExtension()Description copied from interface:ExtensionItemInfoJersey extensions detected byJerseyInstallerinterface. Note that jersey extensions areExtensionItemInfo.isWebExtension().Don't confuse with
ExtensionItemInfo.isJerseyManaged()which indicates what ioc manage extension instance (guice/hk2).- Specified by:
isJerseyExtensionin interfaceExtensionItemInfo- Returns:
- true if extension is a jersey extension
-