DI Container - manywho/sdk-java GitHub Wiki

DI Container

Currently the SDK is locked to using the HK2 container shipped with Jersey 2, but it supplies quite a few handy things that are available for you to inject in your service:

Factories

Classes

ActionParser

  • Scope: Singleton

ExceptionMapperProvider

JedisPoolFactory

  • Scope: Singleton
  • Injects: redis.clients.jedis.JedisPool

This created JedisPool instance is configured using whichever implementation of RedisConfiguration is in the DI container.

ObjectBuilder

  • Scope: Singleton

ObjectMapperFactory

  • Scope: Singleton
  • Injects on com.fasterxml.jackson.databind.ObjectMapper
  • Ranked: 1

PropertyCollectionParser

  • Scope: Singleton

RunService

RedisConfiguration

  • Scope: Singleton
  • Ranked: 1

ServiceConfiguration

  • Ranked: 1

ServiceConfigurationDefault

ServiceConfigurationEnvironmentVariables

ServiceConfigurationProperties

  • Scope: Singleton

TypeBuilder

  • Scope: Singleton

TypeParser

  • Scope: Singleton