Class DynamicRegistrationBean<D extends Registration.Dynamic>
java.lang.Object
org.springframework.boot.web.servlet.RegistrationBean
org.springframework.boot.web.servlet.DynamicRegistrationBean<D>
- Type Parameters:
- D- the dynamic registration result
- All Implemented Interfaces:
- Aware,- BeanNameAware,- ServletContextInitializer,- Ordered
- Direct Known Subclasses:
- AbstractFilterRegistrationBean,- ServletRegistrationBean
public abstract class DynamicRegistrationBean<D extends Registration.Dynamic>
extends RegistrationBean
implements BeanNameAware
Base class for Servlet 3.0+ 
dynamic based
 registration beans.- Since:
- 2.0.0
- Author:
- Phillip Webb, Moritz Halbritter
- 
Field SummaryFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddInitParameter(String name, String value) Add a single init-parameter, replacing any existing parameter with the same name.protected abstract DaddRegistration(String description, ServletContext servletContext) protected voidReturns a mutable Map of the registration init-parameters.protected final StringgetOrDeduceName(Object value) Deduces the name for this registration.booleanReturns if asynchronous operations are supported for this registration.protected final voidregister(String description, ServletContext servletContext) Register this bean with the servlet context.voidsetAsyncSupported(boolean asyncSupported) Sets if asynchronous operations are supported for this registration.voidsetBeanName(String name) voidsetIgnoreRegistrationFailure(boolean ignoreRegistrationFailure) Sets whether registration failures should be ignored.voidsetInitParameters(Map<String, String> initParameters) Set init-parameters for this registration.voidSet the name of this registration.Methods inherited from class org.springframework.boot.web.servlet.RegistrationBeangetDescription, getOrder, isEnabled, onStartup, setEnabled, setOrder
- 
Constructor Details- 
DynamicRegistrationBeanpublic DynamicRegistrationBean()
 
- 
- 
Method Details- 
setNameSet the name of this registration. If not specified the bean name will be used.- Parameters:
- name- the name of the registration
 
- 
setAsyncSupportedpublic void setAsyncSupported(boolean asyncSupported) Sets if asynchronous operations are supported for this registration. If not specified defaults totrue.- Parameters:
- asyncSupported- if async is supported
 
- 
isAsyncSupportedpublic boolean isAsyncSupported()Returns if asynchronous operations are supported for this registration.- Returns:
- if async is supported
 
- 
setInitParametersSet init-parameters for this registration. Calling this method will replace any existing init-parameters.- Parameters:
- initParameters- the init parameters
- See Also:
 
- 
getInitParametersReturns a mutable Map of the registration init-parameters.- Returns:
- the init parameters
 
- 
addInitParameterAdd a single init-parameter, replacing any existing parameter with the same name.- Parameters:
- name- the init-parameter name
- value- the init-parameter value
 
- 
registerDescription copied from class:RegistrationBeanRegister this bean with the servlet context.- Specified by:
- registerin class- RegistrationBean
- Parameters:
- description- a description of the item being registered
- servletContext- the servlet context
 
- 
setIgnoreRegistrationFailurepublic void setIgnoreRegistrationFailure(boolean ignoreRegistrationFailure) Sets whether registration failures should be ignored. If set to true, a failure will be logged. If set to false, anIllegalStateExceptionwill be thrown.- Parameters:
- ignoreRegistrationFailure- whether to ignore registration failures
- Since:
- 3.1.0
 
- 
setBeanName- Specified by:
- setBeanNamein interface- BeanNameAware
 
- 
addRegistration
- 
configure
- 
getOrDeduceNameDeduces the name for this registration. Will return user specified name or fallback to the bean name. If the bean name is not available, convention based naming is used.- Parameters:
- value- the object used for convention based names
- Returns:
- the deduced name
 
 
-