title: Spring Controller threadsafe
body: <p>My question is on threadsafe on Spring controller(finally Servlet class). </p>
  
  <p>1) If i define a varibale static final int i =0, will it cause threadsafe issue, but, I have declared static and final
  2) What about declaring enum as global variable like protected enum Mytype{start, stop}?
  3)decalring @Autowired is threadsafe?</p>
  
  <p>I have foumd a good article on this, but I need more clarity on above questions.
  <a href="http://www.javaworld.com/javaworld/jw-07-2004/jw-0712-threadsafe.html" rel="nofollow">Refer</a></p>
  
  <p>Code:</p>
  
  <pre><code>@Controller
  Public class Test{
  @Autowired MyTest mt;  // Autowired, thread safe?
  private final String s = "abc"; // final, threadsafe?
  private static final int i =0; // again final threadsafe?
  private static int x = 0; // only static threadsafe?    
  protected enum Mytype{head, tail}; // enum, threadsafe?
  .....
  }
  </code></pre>