com.ibm.openpages.api.service

## Class ServiceFactory

- java.lang.Object
- - com.ibm.openpages.api.service.ServiceFactory

-     public final class ServiceFactory
      extends java.lang.Object

  Gives access to an OpenPages service factory class. Multiple implementations of service factory are available to support different flavors of the public API, for example, local versus remote.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceFactory()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static IServiceFactory` | `getServiceFactory(Context context)` Instantiates a service factory based on the factory class name specified by the com.ibm.openpages.sdk.service.factory key in the context.
    `static IServiceFactory` | `getServiceFactory(HttpServletRequest request)` Instantiates a service factory based on the http request.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServiceFactory

          public ServiceFactory()

  - ### Method Detail

    - #### getServiceFactory

          public static IServiceFactory getServiceFactory(Context context)

      Instantiates a service factory based on the factory class name specified by the com.ibm.openpages.sdk.service.factory key in the context. The returned service factory instance is not thread safe and API consumers should handle thread safety.
      Parameters:
        `context` - the context
      Returns:
        an IServiceFactory instance if successful; otherwise null

    - #### getServiceFactory

          public static IServiceFactory getServiceFactory(HttpServletRequest request)

      Instantiates a service factory based on the http request. The returned service factory instance is not thread safe and API consumers should handle thread safety.
      Parameters:
        `request` - the http request
      Returns:
        an IServiceFactory instance if successful; otherwise throw an OpenPagesException error

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2022. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.