isEnabled checks if JMX is enabled
()
| 98 | |
| 99 | // isEnabled checks if JMX is enabled |
| 100 | func (j *jmxConfig) isEnabled() bool { |
| 101 | // Check BPL_JMX_ENABLED first (Cloud Native Buildpacks convention) |
| 102 | bplEnabled := os.Getenv("BPL_JMX_ENABLED") |
| 103 | if bplEnabled == "true" || bplEnabled == "1" { |
| 104 | return true |
| 105 | } |
| 106 | if bplEnabled == "false" || bplEnabled == "0" { |
| 107 | return false |
| 108 | } |
| 109 | |
| 110 | // Check JBP_CONFIG_JMX environment variable (Java Buildpack convention) |
| 111 | return j.Enabled |
| 112 | } |
| 113 | |
| 114 | // getPort returns the JMX port |
| 115 | func (j *jmxConfig) getPort() int { |