I am new to this field and i don't have any clue whatsoever on how to achieve the following goal.
I am taking an example to explain this. I need a java code which calls a rest api on some event. The event could be say a daily event like hit the api daily at noon or whenever the administrator registers a new event. I can write this code but this code should run forever i.e. whenever there is an event it should trigger the api hence in my understanding it must be put on a server.
Now here is my doubt say how to go about doing this. I have read that i could make a servlet and the request and response object would not do anything and since it will be a web application hence it would always be running in tomcat container on a web-server and i could stick my whole code there. But i do not know if this is the right way i am tackling the problem.
EDIT I am trying to implement a server which calls the Google cloud messaging api hence it has to send push notification to all the registered users and the user details are in mysql server. The administrator of this server has the right to register new event like what all notification he needs to send suppose he wants to send just one time notification like happy new year to all the registered user or say he wants to send a daily notification at a particular time say good morning. Now these are the events which has to be registered and listened by the server and on the occurance of event the server just has to make a JSONObject and call the GCM service. And also please guide me how to deploy this on server.
Hope it is much clear now
PS: Sorry if the question seems absurd bear with a novice and help me learn.