Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] (no subject)

How I do this:

1) Start your program by constructing and running a Thread.
2) Do this in the init() method of a Servlet invoked by your WAR (which can be called more than once, so make sure you only start your  Thread once!),
3) Make sure the web.xml file tells that servlet to 'startOnLoad'.

Chris


On Saturday, December 21, 2013 at 9:13:41 PM, Thomas Jung wrote:
> Hey there,

>  
>   
> i've got a question concerning the Integration of jetty into a jar program.
>   
>  
>   
> i'm trying to build a java applications which is supposed to run
> 24/7 like kinda service. Best example would be if you think of it
> like a little homerouter. The program is doing it's stuff, and from
> time to time a user is logging in to it, to supervise the work (live
> data) and adjust it's configuration.
>   
> So i don't want it just to work and process data, while a user is
> logged in which requires an open webbrowser.
>   
> It should do his tasks all the time.
>   
>  
>   
> The problem for ne is now, i don't know how to reach my program
> from a browser when it's not a war file. 
>   
> I Need to get the Web server the Data from my running jar file.
> Thinking of the router example again, i would asking the program how
> much traffic has eben went through the wan interface. 
>   
> So jetty has to ask this question to my constantly running jar file
> and delivering the answer to the web. Therefore it would make no
> sense, letting jetty Start my program, deliver the Data and shut it down again (closing the browser).
>   
>  
>   
> Has anyone done this before and Is it possible to do with jetty,
> furthermore is it possible at all with java?
>   
>  
>   
> I will be very glad maybe just for some buzzwords to continue
> reading. Currently i'm a little bit lost and don't know where to look.
>   
>  
>   
> Thank you
>   
>  
>   
>  
>   
>  




Back to the top