Centralized Exception Handler

Hi Frank,

I want to have a centralized exception handler for my Agent. I am using AgentConfigManager as the agent here.

Is there any hook point where I can put my catch block and have a centralized exception handling code in place? ( E.g. similar to AOP in Spring? )

–Anirban

Hi Anirban,

What do you want to do in the exception handling?
Is the main purpose of getting notified or do you really want to “handle” the exception and continue operation?

Best regards,
Frank

Hi Frank,

This application is already in production for some of the really big telecom operators.
The biggest use cases are:

1.Sending Traps.
2. Sending notification by SMS.
3. Handle the Exception based on type/ code and take appropriate action (modify the output, customized error messages, queuing and retries etc…).

I can still do some of these. But this would be scattered across application. Need centralized place to manage, i.e. Once an exception is thrown that would propagate to a single point where I can handle it.

–Anirban

There is currently no such mechanism. You can get close to it, if you implement/overwrite a LogFactory and register that as logger. Every log entry of level WARN and especially ERROR is throwing an exception. Some of them will be handled (ignored) by the SNMP4J code but most of them not.

I think this is one of the very important required features if I want to use your apis to build my own SNMP Agent.