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
public class ExtensionItemInfoImpl extends ClassItemInfoImpl implements ExtensionItemInfo
Extension item info implementation.- Since:
- 06.07.2016
-
-
Constructor Summary
Constructors Constructor Description ExtensionItemInfoImpl(java.lang.Class<?> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<ItemId>
getDisabledBy()
Item may be disabled either from root application class or fromGuiceyBundle
.java.lang.Class<? extends FeatureInstaller>
getInstalledBy()
Each extension is always registered by single installer.FeatureInstaller
getInstaller()
com.google.inject.Binding
getManualBinding()
boolean
isEnabled()
Item is enabled if no one disable it (DisableSupport.getDisabledBy()
is empty).boolean
isFromScan()
boolean
isGuiceBinding()
Indicates extensions, recognized from guice modules.boolean
isJerseyManaged()
Indicates extension management by jersey instead of guice.boolean
isLazy()
Lazy beans are not registered in guice by default.boolean
isOptional()
Optional extensions are registered directly in guicey bundles.void
setInstaller(FeatureInstaller installer)
void
setJerseyManaged(boolean jerseyManaged)
void
setLazy(boolean lazy)
void
setManualBinding(com.google.inject.Binding manualBinding)
void
setOptional(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, isRegistered, isRegisteredDirectly, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ru.vyarus.dropwizard.guice.module.context.info.ItemInfo
getId, getIgnoresByScope, getIgnoresByScope, getItemType, getRegisteredBy, getRegistrationAttempts, getRegistrationScope, getRegistrationScopeType, getType, isRegistered, isRegisteredDirectly
-
-
-
-
Method Detail
-
getDisabledBy
public java.util.Set<ItemId> getDisabledBy()
Description copied from interface:DisableSupport
Item may be disabled either from root application class or fromGuiceyBundle
. For application,Application
class stored as context and for guicey bundle actual bundle instance id is stored.- Specified by:
getDisabledBy
in interfaceDisableSupport
- 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 interfaceDisableSupport
- Returns:
- true if item enabled, false otherwise
-
getInstalledBy
public java.lang.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 interfaceExtensionItemInfo
- Returns:
- installer installed this extension
-
isFromScan
public boolean isFromScan()
- Specified by:
isFromScan
in interfaceScanSupport
- 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 interfaceExtensionItemInfo
- 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.- Specified by:
isJerseyManaged
in interfaceExtensionItemInfo
- 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 interfaceExtensionItemInfo
- 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 interfaceExtensionItemInfo
- Returns:
- true if extension is optional
-
setLazy
public void setLazy(boolean lazy)
-
setJerseyManaged
public void setJerseyManaged(boolean jerseyManaged)
-
setManualBinding
public void setManualBinding(com.google.inject.Binding manualBinding)
-
getManualBinding
public com.google.inject.Binding getManualBinding()
-
getInstaller
public FeatureInstaller getInstaller()
-
setInstaller
public void setInstaller(FeatureInstaller installer)
-
setOptional
public void setOptional(boolean optional)
-
-