Interface ServiceFactory<T extends Service>
-
- Type Parameters:
T
- the type parameter
- All Superinterfaces:
org.springframework.core.Ordered
public interface ServiceFactory<T extends Service> extends org.springframework.core.Ordered
TheServiceFactory
is responsible for creating service objects.- Since:
- 4.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
createService(java.lang.String id)
Create service based on an identifier.<T extends Service>
TcreateService(java.lang.String id, java.lang.Class<T> clazz)
Create the service object based on an identifier.T
createService(javax.servlet.http.HttpServletRequest request)
Create service object based on the parameters of the request.<T extends Service>
TcreateService(javax.servlet.http.HttpServletRequest request, java.lang.Class<T> clazz)
Create service based on the given parameters provided by the http request.
-
-
-
Method Detail
-
createService
T createService(javax.servlet.http.HttpServletRequest request)
Create service object based on the parameters of the request.- Parameters:
request
- the request- Returns:
- the service
-
createService
T createService(java.lang.String id)
Create service based on an identifier.- Parameters:
id
- the id- Returns:
- the service object
-
createService
<T extends Service> T createService(java.lang.String id, java.lang.Class<T> clazz)
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 fromService
itself.- Type Parameters:
T
- the type parameter- Parameters:
id
- the idclazz
- the clazz- Returns:
- the t
-
createService
<T extends Service> T createService(javax.servlet.http.HttpServletRequest request, java.lang.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 fromService
itself.- Type Parameters:
T
- the type parameter- Parameters:
request
- the requestclazz
- the clazz- Returns:
- the t
-
-