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
The ServiceFactory is responsible for creating service objects.
Since:
4.2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Flag 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 Type
    Method
    Description
    createService(jakarta.servlet.http.HttpServletRequest request)
    Create service object based on the parameters of the request.
    <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.
    Create service based on an identifier.
    createService(String id, jakarta.servlet.http.HttpServletRequest request)
    Create service t.
    <T extends Service>
    T
    createService(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

      static final String 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

      T createService(jakarta.servlet.http.HttpServletRequest request)
      Create service object based on the parameters of the request.
      Parameters:
      request - the request
      Returns:
      the service
    • createService

      T createService(String id, jakarta.servlet.http.HttpServletRequest request)
      Create service t.
      Parameters:
      id - the id
      request - the request
      Returns:
      the t
    • createService

      T createService(String id)
      Create service based on an identifier.
      Parameters:
      id - the id
      Returns:
      the service object
    • createService

      <T extends Service> T createService(String id, 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 from Service itself.
      Type Parameters:
      T - the type parameter
      Parameters:
      id - the id
      clazz - 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 from Service itself.
      Type Parameters:
      T - the type parameter
      Parameters:
      request - the request
      clazz - the clazz
      Returns:
      the t