Hi Daniel,

The focus of this issue was to decouple hard-dependency between java.management module and jdk.snmp module since jdk.snmp is not a core module. There was not much focus on an 'Agent' Interface that could allow plugging in any Agent. Hence there was no discussions around the structure of such an interface.

On Tuesday 23 August 2016 04:11 PM, Daniel Fuchs wrote:
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).

Any effort towards creating such an interface will require participation from much larger audience and if required could be tracked via a separate JEP. I would like to consider that to be out-of-scope of current issue.


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?

Port can be made a part of env variables (Property) and we could have getProperty method to retrieve port no. But we have to draw a line somewhere as to when do we stop making this the generic interface that allows plugging in any Agent. Where do you think we should be drawing the line?
best regards,

-- daniel
Regards
Harsha

Reply via email to