GeeCON Prague 2014*
The moose likes General Computing and the fly likes running java on remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » General Computing
Bookmark "running java on remote server" Watch "running java on remote server" New topic
Author

running java on remote server

robert peach
Greenhorn

Joined: Apr 27, 2013
Posts: 2
Hi,

I have recently written a programme which I hope to run continuously on a remote server so that it can constantly send updated information to my friends (as opposed to running on my home computer non-stop). I have been playing around with using tomcat in eclipse, and I can get my programme to run on localhost.

I'm not overly good at networking etc, so my question is whether it is possible to merely rent a web server and have my programme run continuously (just looped) on it? Then I could connect to the web server from my home computer when I need to make changes to the programme etc. If this is possible, what route should I take?

Cheers
chan wenbi
Greenhorn

Joined: Apr 05, 2013
Posts: 1
i am sure that you could rent machine as web server. Certainly you are also apply Google App Engine (GAE)to running your application. If you are going to update application, then to redeploy by GAE tools.
robert peach
Greenhorn

Joined: Apr 27, 2013
Posts: 2
Ok I have looked at google app engine as you recommended, it seems to be able to do the job.

I do have a couple of questions regarding it, however. Is it possible, once I have deployed the project to run as a web application, that one of the java classes can run continuously on a loop without the need for a request from a user. The looping program would then constantly update the datastore with an array of information. A java class that allows the user to correspond with the webserver would then be able to collect information from the datastore and use it.

How would I get a program to run continuously without the need of a user request?

Cheers
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42035
    
  64
For running background jobs check out the java.util.Timer and TimerTask classes. They can be started from a ContextListener (assuming that GAE supports either of these classes - I have no idea).

GAE imposes certain limitations on your web apps, though. Maybe more standard hosting providers like those listed in http://www.coderanch.com/how-to/java/ServletsFaq#hosting would be more appropriate. Hard to say from the description, though.


Ping & DNS - my free Android networking tools app
 
GeeCON Prague 2014
 
subject: running java on remote server