title: How can I capture request data in a static list
body: <p>I am having a URL for e.g:</p>
  
  <pre><code>http://some_url.suffix?data=test1.
  </code></pre>
  
  <p>I will be having multiple request of the sort:</p>
  
  <pre><code>http://some_url.suffix?data=test1
  http://some_url.suffix?data=test2
  http://some_url.suffix?data=test3
  http://some_url.suffix?data=test4
  </code></pre>
  
  <p>I want to maintain a static list at server side which will contain data received from requests across all sessions</p>
  
  <pre><code>List&lt;String&gt; data;
  </code></pre>
  
  <p>List will contain data1,data2,data3,data4. List will be cleared after particular interval and new list will be used for subsequent requests.
  What is the best option to achieve this:</p>
  
  <pre><code>1. static List&lt;String&gt; data = new CopyOnWriteArrayList&lt;String&gt;();
  2. Singleton wrapper class to perform operation on normal java.util.List
  3. using synchronized block
  </code></pre>