public enum InstallersOptions extends java.lang.Enum<InstallersOptions> implements Option
CoreInstallersBundle and WebInstallersBundle
installers.| Enum Constant and Description |
|---|
DenyServletRegistrationWithClash
Affects
WebServletInstaller. |
DenySessionListenersWithoutSession
Affects
WebListenerInstaller. |
ForceSingletonForJerseyExtensions
Force singleton scope for jersey extensions (including resources).
|
JerseyExtensionsManagedByGuice
By default, HK2 related extensions like resources or other jersey specific extensions are managed by
guice (guice-managed instance is registered in HK2).
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
getDefaultValue() |
java.lang.Class<?> |
getType() |
static InstallersOptions |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static InstallersOptions[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final InstallersOptions DenyServletRegistrationWithClash
WebServletInstaller.
During servlet registration, url patterns may clash with already installed servlets. By default, only warning
will be printed in log. Set option to true to throw exception on registration if clash detected.
Note: clash resolution depends on servlets registration order. Moreover, clash may appear on some 3rd party servlet registration (not managed by installer) and so be not affected by this option.
public static final InstallersOptions DenySessionListenersWithoutSession
WebListenerInstaller.
By default, dropwizard does not have configured sessions support (to be stateless), so session listeners
can't be installed.
Because session listeners may be defined as part of 3rd party bundles and most likely will complement bundle
functionality (aka optional part), listener installer will only log warning about not installed listeners.
Set option to true to throw error instead (when session listeners can't be installed because of no
sessions support enabled).public static final InstallersOptions JerseyExtensionsManagedByGuice
JerseyManaged annotation could switch
annotated beans to be managed by HK2. But in some cases, it is more convenient to always use HK2 and this
option is supposed to be used exactly for such cases.
When false value set, all beans, managed by jersey installers
(JerseyInstaller) should register beans for
HK2 management. JerseyManaged become
useless in this case, instead GuiceManaged
annotation could be used.
Note that even managed by HK2 beans will be singletons. Still this will not block you from using
@Context annotation injections, because HK2 will proxy such injections and properly handle
multi-threaded access (implicit provider).
NOTE: guice aop is not applicable for beans managed by HK2 (because guice aop use class proxies and not instance proxies).
Startup will fail if HK2 bridge is not enabled
(see GuiceyOptions.UseHkBridge) because without it you can't inject
any guice beans into HK2 managed instances (and if you don't need to then you don't need guice support at all).
public static final InstallersOptions ForceSingletonForJerseyExtensions
Note that forced singleton is not applied to beans with explicit scoping annotation set.
Prototype annotation may be used to force
default (prototype) scope instead of singleton.
When switched off, extension scope will be driven only by scope annotation. Note that by default guice and HK2 use prototype scope (for example, for resources it means new instance for each request).
public static InstallersOptions[] values()
for (InstallersOptions c : InstallersOptions.values()) System.out.println(c);
public static InstallersOptions valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic java.lang.Class<?> getType()
public java.lang.Object getDefaultValue()
getDefaultValue in interface Option