Pergunta

One of our apps exposes management MBeans that allow developers to prod it in various ways. These are typically long-running operations such as reprocessing historical inputs, refreshing reference data, etc.

If these operations fail or encounter significant problems, the MBean operation will send an email to the group with some relevant information.

However this is totally without context for everyone except the person that invoked the operation. Therefore I want to be able to determine who clicked the button, in order to send an email just to them.

I am happy with looking up an email address based on some kind of user discriminator. And this is a dev process, so it's more about convenience than security - e.g. relying on System.getProperty("user.name") would be acceptable.


Is there some way an MBean operation can tell who clicked the button in JConsole to invoke it? Perhaps by getting the client to automatically pass through its system properties, or by adding a parameter to the method that is automatically populated by the client? Is there some static/threadlocal context of the JMX connection I can look up from within the method? (Even the client's hostname would be a good enough discriminator)?

Foi útil?

Solução

There is no client context available in JMX today, maybe it will be added for JDK 9.

http://weblogs.java.net/blog/emcmanus/archive/2008/12/client_context_1.html

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top