Interface ServiceFactory<T extends Service>
- Type Parameters:
T- the type parameter
- All Superinterfaces:
org.springframework.core.Ordered
The
ServiceFactory is responsible for creating service objects.- Since:
- 4.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFlag as a request attribute to indicate if the factory should collect service attributes such as request headers, cookies, etc.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptioncreateService(jakarta.servlet.http.HttpServletRequest request) Create service object based on the parameters of the request.<T extends Service>
TcreateService(jakarta.servlet.http.HttpServletRequest request, Class<T> clazz) Create service based on the given parameters provided by the http request.createService(String id) Create service based on an identifier.createService(String id, jakarta.servlet.http.HttpServletRequest request) Create service t.<T extends Service>
TcreateService(String id, Class<T> clazz) Create the service object based on an identifier.Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Field Details
-
COLLECT_SERVICE_ATTRIBUTES
Flag as a request attribute to indicate if the factory should collect service attributes such as request headers, cookies, etc.- See Also:
-
-
Method Details
-
createService
Create service object based on the parameters of the request.- Parameters:
request- the request- Returns:
- the service
-
createService
Create service t.- Parameters:
id- the idrequest- the request- Returns:
- the t
-
createService
Create service based on an identifier.- Parameters:
id- the id- Returns:
- the service object
-
createService
Create the service object based on an identifier. Allows the final service object to be casted to the desired service class that may not immediately inherit fromServiceitself.- Type Parameters:
T- the type parameter- Parameters:
id- the idclazz- the clazz- Returns:
- the t
-
createService
<T extends Service> T createService(jakarta.servlet.http.HttpServletRequest request, Class<T> clazz) Create service based on the given parameters provided by the http request. Allows the final service object to be casted to the desired service class that may not immediately inherit fromServiceitself.- Type Parameters:
T- the type parameter- Parameters:
request- the requestclazz- the clazz- Returns:
- the t
-