• Post Reply Bookmark Topic Watch Topic
  • New Topic

Context scope attributes. Thread safety.  RSS feed

 
Rohit Kelkar
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way that the context attributes can be made thread safe?
 
Stefan Zoerner
Author
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make all attributes private and synchronize the accessor methods etc. to it via modifier.
I think it should work the same way as in standard Java.
Greetings from Hamburg,
Stefan
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!