类 DynamicRegistrationBean<D extends Registration.Dynamic>
java.lang.Object
org.springframework.boot.web.servlet.RegistrationBean
org.springframework.boot.web.servlet.DynamicRegistrationBean<D>
- 类型参数:
D
- the dynamic registration result
- 所有已实现的接口:
Aware
,BeanNameAware
,ServletContextInitializer
,Ordered
public abstract class DynamicRegistrationBean<D extends Registration.Dynamic>
extends RegistrationBean
implements BeanNameAware
Base class for Servlet 3.0+
dynamic
based
registration beans.- 从以下版本开始:
- 2.0.0
- 作者:
- Phillip Webb, Moritz Halbritter
-
字段概要
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
addInitParameter
(String name, String value) Add a single init-parameter, replacing any existing parameter with the same name.protected abstract D
addRegistration
(String description, ServletContext servletContext) protected void
Returns a mutable Map of the registration init-parameters.protected final String
getOrDeduceName
(Object value) Deduces the name for this registration.boolean
Returns if asynchronous operations are supported for this registration.protected final void
register
(String description, ServletContext servletContext) Register this bean with the servlet context.void
setAsyncSupported
(boolean asyncSupported) Sets if asynchronous operations are supported for this registration.void
setBeanName
(String name) void
setIgnoreRegistrationFailure
(boolean ignoreRegistrationFailure) Sets whether registration failures should be ignored.void
setInitParameters
(Map<String, String> initParameters) Set init-parameters for this registration.void
Set the name of this registration.从类继承的方法 org.springframework.boot.web.servlet.RegistrationBean
getDescription, getOrder, isEnabled, onStartup, setEnabled, setOrder
-
构造器详细资料
-
DynamicRegistrationBean
public DynamicRegistrationBean()
-
-
方法详细资料
-
setName
Set the name of this registration. If not specified the bean name will be used.- 参数:
name
- the name of the registration
-
setAsyncSupported
public void setAsyncSupported(boolean asyncSupported) Sets if asynchronous operations are supported for this registration. If not specified defaults totrue
.- 参数:
asyncSupported
- if async is supported
-
isAsyncSupported
public boolean isAsyncSupported()Returns if asynchronous operations are supported for this registration.- 返回:
- if async is supported
-
setInitParameters
Set init-parameters for this registration. Calling this method will replace any existing init-parameters.- 参数:
initParameters
- the init parameters- 另请参阅:
-
getInitParameters
Returns a mutable Map of the registration init-parameters.- 返回:
- the init parameters
-
addInitParameter
Add a single init-parameter, replacing any existing parameter with the same name.- 参数:
name
- the init-parameter namevalue
- the init-parameter value
-
register
从类复制的说明:RegistrationBean
Register this bean with the servlet context.- 指定者:
register
在类中RegistrationBean
- 参数:
description
- a description of the item being registeredservletContext
- the servlet context
-
setIgnoreRegistrationFailure
public void setIgnoreRegistrationFailure(boolean ignoreRegistrationFailure) Sets whether registration failures should be ignored. If set to true, a failure will be logged. If set to false, anIllegalStateException
will be thrown.- 参数:
ignoreRegistrationFailure
- whether to ignore registration failures- 从以下版本开始:
- 3.1.0
-
setBeanName
- 指定者:
setBeanName
在接口中BeanNameAware
-
addRegistration
-
configure
-
getOrDeduceName
Deduces 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.- 参数:
value
- the object used for convention based names- 返回:
- the deduced name
-