MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / detectInstalledAgent

Method detectInstalledAgent

src/java/jres/jvmkill.go:115–132  ·  view source on GitHub ↗

detectInstalledAgent checks if JVMKill was previously installed and sets agentPath

()

Source from the content-addressed store, hash-verified

113
114// detectInstalledAgent checks if JVMKill was previously installed and sets agentPath
115func (j *JVMKillAgent) detectInstalledAgent() {
116 binDir := filepath.Join(j.jreDir, "bin")
117
118 // Try to find jvmkill-*.so files
119 entries, err := os.ReadDir(binDir)
120 if err != nil {
121 return
122 }
123
124 for _, entry := range entries {
125 name := entry.Name()
126 if filepath.Ext(name) == ".so" && len(name) > 7 && name[:7] == "jvmkill" {
127 j.agentPath = filepath.Join(binDir, name)
128 j.ctx.Log.Debug("Detected installed JVMKill agent: %s", j.agentPath)
129 return
130 }
131 }
132}
133
134// Finalize adds JVMKill to JAVA_OPTS
135func (j *JVMKillAgent) Finalize() error {

Callers 1

FinalizeMethod · 0.95

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected