0
votes

We have numerous Tomcat containers hosting different web applications. All these applications use a shared library. We need an ability to trigger actions by this shared library.

This could be done through a servlet that all applications would specify in their web.xml file. Actions could then be triggered by a URL. However, that approach does not appear to be very elegant.

I have also looked into MBeans, but not sure if this is a kind of problem they are meant to solve.

Any best practice approaches for doing this are appreciated. Detailed discussion of options to help me think through this would be great.

Thank you.

1

1 Answers

1
votes

I personally don't see why is it wrong to use HTTP POST to trigger something provided you implement a decent authentication mechanism.

Think of MBean as a more powerful monitoring hook. Traditionally, monitoring is a read-only activity but with MBeans you can expose a setter and invoke it with arbitrary value (JMX can offer authentication btw).

Another alternatives:

  • RMI (yuck!)
  • polling some pre-defined URI (yuck!) or JNDI
  • notification via jabber (or another IM protocol)
  • JMS

However it is hard to advice without knowing the full context.