Summary: | Request .getName() to Host/Proc/Task | ||
---|---|---|---|
Product: | frysk | Reporter: | Phil Muldoon <pmuldoon> |
Component: | general | Assignee: | Phil Muldoon <pmuldoon> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | pmuldoon |
Priority: | P1 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Bug Depends on: | |||
Bug Blocks: | 1593 |
Description
Phil Muldoon
2005-10-04 19:42:58 UTC
pmuldoon cagney, something like: java.net.InetAddress.getLocalHost().getHostName() cagney pmuldoon, ok, I wonder how I test this pmuldoon cagney, you could spawn a process that runs: uname -n and capture the output and compare the two? They should be the same 2005-10-31 Phil Muldoon <pmuldoon@redhat.com> * Host.java (getName): Added getName function. * Task.java (getName): Added getName function. Added some simple functions that return "Task "+getTid() in the Task's case, and java.net.InetAddress.getLocalHost().getHostName() in the Hosts case. Added the Task and the Host some time back and forgot to close. Proc has a .getCommand() already implemented. Task: /** * Return the task's (derived) name */ public final String getName () { return "Task " + getTid(); } Proc: /** * Return the basename of the program that this process is * running. */ public String getCommand () { command = sendrecCommand (); return command; } Host: /** * * Returns the name of the host */ public String getName() { try { return java.net.InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { return "Unknown Host"; } } Closing |