RFR : 8131061 - Use of -Dcom.sun.management.snmp needs to be examined for modules
Daniel Fuchs
daniel.fuchs at oracle.com
Tue Aug 23 10:41:13 UTC 2016
Hi,
On 22/08/16 22:58, Mandy Chung wrote:
> sun/management/spi/AgentProvider.java
> 78 public abstract void startAgent(String port, Properties props);
>
> The port parameter should be “int”.
>
I wonder about that. I wonder if the name of the agent provider
should be the name of the property that starts it - for
instance - we could have an agent provider whose name is
"com.sun.management.snmp.port" - and the first parameter to
startAgent would be the value associated with that
property (we'd renamed the port parameter into e.g.
propertyValue).
Then it would be up to the agent provider to interpret the
property value however it sees fit. In this example - a
provider deployed as responding to the "com.sun.management.snmp.port"
property would interpret the value of the property as the SNMP
port number of the SNMP agent to start.
Our implementation could still only look for an agent
provider named "com.sun.management.snmp.port" (instead of
"SnmpAgent") - but that could be extended in the future
if we ever want to start more (different) agents.
Also I'm not sure the AgentProvider should have a getPort() method.
I don't see were it is used? Is it for debugging purposes?
If so maybe it should be getAddress() and return a informal String.
What do you think?
best regards,
-- daniel
More information about the serviceability-dev
mailing list