xbhanu Choudhary

Greenhorn
+ Follow
since Feb 15, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by xbhanu Choudhary

The ScheduledExecutorService scheduler inside contextInitialized method of a listener is not working. Not even printing to the console !!! No exception. no error...what could have gone wrong ???

Please help !!!
8 years ago
Thanks a lot guys, I am getting some idea about the servlet context listener but it's still a little blur

How exactly does this servletcontextlistener thing works ???

I'll make my "API to the middleware" class implement this interface and do the stuff of its main method in contextinitialized method. Then when started, it all will run as a single process inside tomcat ??? or need to schedule some threads ???

8 years ago
oh okay, then i need to study about the ServletContextListener and this contextInitialized method. I just finished a struts tutorial, so thought never have to venture into servlet writing.

Hmmm...so when the app will run in this contextInitialized method, it would run in tomcat's address space so that other servlets can easily access the data from the map. Is it ??

Thanks a lot bud
8 years ago
as luck would have it, there's no GUI code in the app. It just computes. For the GUI part only, i need to combine it with the server, so that user/ops can just type in the url and see the stats and do querying etc. So, you're saying that the app can run inside tomcat, as it was running outside ??
8 years ago
okay forget everything, see it like this -

i have a desktop java application, it contains two maps which are updated at every 60 second interval. These needs to be exposed to whoever wants them through HTTP. So i am gonna need a web server for that say tomcat.
My application becomes a model, i'll use JSP's for the viewer and servlets will be controller. So i am using struts to implement this.

Now, normally you see servlets picking up data from a database or struts action files doing something. I have to get it from this java application. Now how to make this connection b/w tomcat and my standalone java application is the question ???
8 years ago

But the application will have its own memory space.
From what i've heard is that once you deploy a war in tomcat it becomes a process, and my app is also a process. So even though i may use the same classes but they will be two different processes and all the data that i want to query on lies in the application's address space. !!! And there is no GUI involved. Its all core java with some logging.
Feel free to correct me if i am wrong.
8 years ago
I have a standalone java application which uses java based TCP NIO to collect some information from various clients (not on web/HTTP but through some indigenously developed middleware). Now I have to develop a front-end for the users to perform a lot of querying through HTTP. So is there a way to put this application inside tomcat, so that servlets can invoke required functions on this application ???
The thing is it has to listen on that middleware outside tomcat too and at the same time service servlets inside tomcat. How to do this ??

Putting this application outside tomcat and using RMI is an option but I don’t want to do that.
Can embedding tomcat inside my application is an option ???
8 years ago