Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Consumer

crownedzero Nov 15th, 2012 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package domain;
  6.  
  7. import java.util.ArrayList;
  8. import java.util.List;
  9. import java.util.logging.Level;
  10. import java.util.logging.Logger;
  11.  
  12. /**
  13.  *
  14.  * @author crownedzero
  15.  */
  16. public class Consumer implements Runnable {
  17.    
  18.     private List<Message> consumerList = new ArrayList<>();
  19.  
  20.     @Override
  21.     public void run() {
  22.         while (true) {
  23.             try {
  24.                 Message tempMessage = Producer.messageConsume(Thread.currentThread().getName());
  25.                 if (tempMessage.getRegion().equalsIgnoreCase(Thread.currentThread().getName())) {
  26.                     consumerList.add(tempMessage);
  27.                 }  Thread.sleep(500);
  28.             } catch (InterruptedException ex) {
  29.                 Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex);
  30.             }
  31.         }
  32.     }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top