Re: global variable concurrent access in different services
You will love this tutorial: http://www.youtube.com/playlist?list=PLBB24CFB073F1048Efeature=plcp On Mon, Jun 4, 2012 at 3:22 PM, Thiago H de Paula Figueiredo thiag...@gmail.com wrote: On Mon, 04 Jun 2012 09:20:19 -0300, Angelo C. angelochen...@gmail.com wrote: Hi, Hi! This is a situation, in a PageRenderRequestFilter my app need to access a global String variable, and this global variable is updated every hour in a PeriodicExecutor, any suggestion how to do this? will there be a conflict in accessing this variable? Thanks, This isn't related to Tapestry at all: it's just a Java question. To begin with, Java doesn't have global variables. Second, make this variable a private non-static field of a service, provide methods to get and set it and use some Java mechanism to deal with it (volatile keyword, synchronized keyword, java.concurrent classes, etc). -- Thiago H. de Paula Figueiredo --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.orgusers-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org -- *Regards,* *Muhammad Gelbana Java Developer*
global variable concurrent access in different services
Hi, This is a situation, in a PageRenderRequestFilter my app need to access a global String variable, and this global variable is updated every hour in a PeriodicExecutor, any suggestion how to do this? will there be a conflict in accessing this variable? Thanks, Angelo -- View this message in context: http://tapestry.1045711.n5.nabble.com/global-variable-concurrent-access-in-different-services-tp5713602.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: global variable concurrent access in different services
On Mon, 04 Jun 2012 09:20:19 -0300, Angelo C. angelochen...@gmail.com wrote: Hi, Hi! This is a situation, in a PageRenderRequestFilter my app need to access a global String variable, and this global variable is updated every hour in a PeriodicExecutor, any suggestion how to do this? will there be a conflict in accessing this variable? Thanks, This isn't related to Tapestry at all: it's just a Java question. To begin with, Java doesn't have global variables. Second, make this variable a private non-static field of a service, provide methods to get and set it and use some Java mechanism to deal with it (volatile keyword, synchronized keyword, java.concurrent classes, etc). -- Thiago H. de Paula Figueiredo - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org