Class CloudFoundryVcapServicesPropertySourceLoader

  • All Implemented Interfaces:
    io.micronaut.context.env.PropertySourceLoader, io.micronaut.context.env.PropertySourceLocator, io.micronaut.context.env.PropertySourceReader, io.micronaut.core.order.Ordered, io.micronaut.core.util.Toggleable

    @Internal
    public class CloudFoundryVcapServicesPropertySourceLoader
    extends EnvJsonPropertySourceLoader

    A PropertySourceLoader that reads from the environment variable VCAP_SERVICES which is used by CloudFoundry.

    Since:
    2.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int POSITION
      Position for the system property source loader in the chain.
      • Fields inherited from class io.micronaut.context.env.AbstractPropertySourceLoader

        DEFAULT_POSITION, log
      • Fields inherited from interface io.micronaut.core.order.Ordered

        HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected io.micronaut.context.env.MapPropertySource createPropertySource​(java.lang.String name, java.util.Map<java.lang.String,​java.lang.Object> map, int order)  
      protected java.lang.String getEnvValue()  
      java.util.Set<java.lang.String> getExtensions()  
      int getOrder()  
      protected void processInput​(java.lang.String name, java.io.InputStream input, java.util.Map<java.lang.String,​java.lang.Object> finalMap)  
      protected java.util.Optional<java.io.InputStream> readInput​(io.micronaut.core.io.ResourceLoader resourceLoader, java.lang.String fileName)  
      • Methods inherited from class io.micronaut.context.env.AbstractPropertySourceLoader

        isLogEnabled, load, loadEnv, processMap, read, setLogEnabled
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.micronaut.context.env.PropertySourceLoader

        load
      • Methods inherited from interface io.micronaut.context.env.PropertySourceReader

        read
      • Methods inherited from interface io.micronaut.core.util.Toggleable

        isEnabled
    • Field Detail

      • POSITION

        public static final int POSITION
        Position for the system property source loader in the chain.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CloudFoundryVcapServicesPropertySourceLoader

        public CloudFoundryVcapServicesPropertySourceLoader()
      • CloudFoundryVcapServicesPropertySourceLoader

        public CloudFoundryVcapServicesPropertySourceLoader​(boolean logEnabled)
    • Method Detail

      • getEnvValue

        protected java.lang.String getEnvValue()
        Overrides:
        getEnvValue in class EnvJsonPropertySourceLoader
        Returns:
        The JSON stored in the environment variables SPRING_APPLICATION_JSON or MICRONAUT_APPLICATION_JSON.
      • getExtensions

        public java.util.Set<java.lang.String> getExtensions()
        Specified by:
        getExtensions in interface io.micronaut.context.env.PropertySourceReader
        Overrides:
        getExtensions in class JsonPropertySourceLoader
      • readInput

        protected java.util.Optional<java.io.InputStream> readInput​(io.micronaut.core.io.ResourceLoader resourceLoader,
                                                                    java.lang.String fileName)
        Overrides:
        readInput in class EnvJsonPropertySourceLoader
      • processInput

        protected void processInput​(java.lang.String name,
                                    java.io.InputStream input,
                                    java.util.Map<java.lang.String,​java.lang.Object> finalMap)
                             throws java.io.IOException
        Overrides:
        processInput in class JsonPropertySourceLoader
        Throws:
        java.io.IOException
      • createPropertySource

        protected io.micronaut.context.env.MapPropertySource createPropertySource​(java.lang.String name,
                                                                                  java.util.Map<java.lang.String,​java.lang.Object> map,
                                                                                  int order)
        Overrides:
        createPropertySource in class io.micronaut.context.env.AbstractPropertySourceLoader