In order to call a method outside the application, you have to provide one of the following:
- RMI server; or
- Sockets server.
In every case, you should implement code in your web application to allow other proccess to comunicate with it and access its methods.
The closer to what you need is RMI, that literally allows you to invoke remote methods, but it will need that both sides to maintain an Interface of which methods may be called.