Code example for ConcurrentLinkedQueue

0
import java.util.Queue; 
import java.util.concurrent.ConcurrentLinkedQueue; 
 
public class DashboardService { 
 
    private Queue<String> stockPriceQueue = new ConcurrentLinkedQueue<String>();
 
    public String getStockQuote() {
        String stockQuote = stockPriceQueue.poll();
        return stockQuote != null ? stockQuote : "";
    } 
 
    public void log(OMElement omElement) {
        System.out.println("Event received : " + omElement.toString());
    } 
 
    public void addStockQuote(OMElement stockQuote) {
        System.out.println("Received event : " + stockQuote.toString());
        try { 
            AXIOMXPath symbolXPath = new AXIOMXPath("//stockQuoteEvent/stockSymbol");
            AXIOMXPath priceXPath = new AXIOMXPath("//stockQuoteEvent/stockPrice");