Class SimpleRegistry

java.lang.Object
org.openehealth.ipf.commons.core.config.SimpleRegistry
All Implemented Interfaces:
Registry

public class SimpleRegistry extends Object implements Registry
A simple registry implementation that can e.g. be used in tests to abstract away more complex bean registries like Spring. This is sometimes easier to use than mocking the requests to individual methods. Note that no synchronization is done for adding beans or clearing the registry.
  • Constructor Details

    • SimpleRegistry

      public SimpleRegistry()
  • Method Details

    • bean

      public Object bean(String name)
      Specified by:
      bean in interface Registry
      Parameters:
      name - bean name
      Returns:
      bean of given name
    • bean

      public <T> T bean(Class<T> requiredType)
      Specified by:
      bean in interface Registry
      Parameters:
      requiredType - bean type
      Returns:
      first bean of given type
    • beans

      public <T> Map<String,T> beans(Class<T> requiredType)
      Specified by:
      beans in interface Registry
      Parameters:
      requiredType - bean type
      Returns:
      all beans of given type
    • register

      public Object register(String name, Object object)
    • clear

      public void clear()