score:3

Accepted answer

there is no such thing as a main method for webapps and wars.

if you want something to startup when the deployment is complete, you'll want to create, setup, and configure a custom javax.servlet.servletcontextlistener where your implementation of contextinitialized(servletcontextevente sce) performs your twitter storm topology.

or

you can skip the entire deploy of a war on a standalone jetty process. to do that you would setup an embedded jetty instance where you can do whatever you want in your own custom main, from starting up jetty itself, to adding your webapp, to executing your own custom code.

see the onewebapp embedded example.

in your use case, you would initialize your 'twitter storm topology' after the server.start(); and before the server.join();


Related Query

More Query from same tag