MCPcopy Index your code
hub / github.com/cloudfoundry/java-buildpack / loadConfig

Method loadConfig

src/java/frameworks/jmx.go:78–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76}
77
78func (j *JmxFramework) loadConfig() (*jmxConfig, error) {
79 // initialize default values
80 jConfig := jmxConfig{
81 Enabled: false,
82 Port: 5000,
83 }
84 config := os.Getenv("JBP_CONFIG_JMX")
85 if config != "" {
86 yamlHandler := common.YamlHandler{}
87 err := yamlHandler.ValidateFields([]byte(config), &jConfig)
88 if err != nil {
89 j.context.Log.Warning("Unknown user config values: %s", err.Error())
90 }
91 // overlay JBP_CONFIG_JMX over default values
92 if err = yamlHandler.Unmarshal([]byte(config), &jConfig); err != nil {
93 return nil, fmt.Errorf("failed to parse JBP_CONFIG_JMX: %w", err)
94 }
95 }
96 return &jConfig, nil
97}
98
99// isEnabled checks if JMX is enabled
100func (j *jmxConfig) isEnabled() bool {

Callers 4

DetectMethod · 0.95
SupplyMethod · 0.95
FinalizeMethod · 0.95
java_opts_test.goFile · 0.45

Calls 2

ValidateFieldsMethod · 0.95
UnmarshalMethod · 0.95

Tested by

no test coverage detected