Class JerseyFeatureInstaller
java.lang.Object
ru.vyarus.dropwizard.guice.module.installer.feature.jersey.JerseyFeatureInstaller
- All Implemented Interfaces:
FeatureInstaller,InstanceInstaller<jakarta.ws.rs.core.Feature>
public class JerseyFeatureInstaller
extends Object
implements FeatureInstaller, InstanceInstaller<jakarta.ws.rs.core.Feature>
Jersey feature installer.
Search classes implementing
Feature. Directly register instance in jersey context.
Installer is useful when guice-managed component required for configuration.
- Since:
- 13.01.2016
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMethod used by extensions help report (GuiceBundle.Builder.printExtensionsHelp()) to show what signs this exact installer recognize so user could better understand extensions support specifics.voidinstall(io.dropwizard.core.setup.Environment environment, jakarta.ws.rs.core.Feature instance) UseFeatureUtils.getInstanceClass(instance)to overcome proxies and get correct type.booleanNOTE: consider usingru.vyarus.dropwizard.guice.module.installer.util.FeatureUtilsto simplify checks (for example, types most likely must be checks to be not abstract).voidreport()Called to log registered endpoints in dropwizard log fashion.
-
Constructor Details
-
JerseyFeatureInstaller
public JerseyFeatureInstaller()
-
-
Method Details
-
matches
Description copied from interface:FeatureInstallerNOTE: consider usingru.vyarus.dropwizard.guice.module.installer.util.FeatureUtilsto simplify checks (for example, types most likely must be checks to be not abstract).When type accepted by any extension it's registered in guice module.
- Specified by:
matchesin interfaceFeatureInstaller- Parameters:
type- type to check- Returns:
- true if extension recognized, false otherwise
-
report
public void report()Description copied from interface:FeatureInstallerCalled to log registered endpoints in dropwizard log fashion. It's important to naturally show all dynamically resolved classes to easily catch errors. UseReporterto simplify reporting.Method may do nothing if reporting not required
- Specified by:
reportin interfaceFeatureInstaller
-
install
public void install(io.dropwizard.core.setup.Environment environment, jakarta.ws.rs.core.Feature instance) Description copied from interface:InstanceInstallerUseFeatureUtils.getInstanceClass(instance)to overcome proxies and get correct type.Full
Injectorcould be obtained withInjectorLookup.getInjector(Environment).Shared state could be obtained with
SharedConfigurationState.get(Environment)- Specified by:
installin interfaceInstanceInstaller<jakarta.ws.rs.core.Feature>- Parameters:
environment- environment objectinstance- extension instance
-
getRecognizableSigns
Description copied from interface:FeatureInstallerMethod used by extensions help report (GuiceBundle.Builder.printExtensionsHelp()) to show what signs this exact installer recognize so user could better understand extensions support specifics.- Specified by:
getRecognizableSignsin interfaceFeatureInstaller- Returns:
- list of extension signs installer recognize
-