osipyonok

SP_Lab4_CALC_Main

Dec 25th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.18 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.Arrays;
  3. import java.util.HashSet;
  4. import java.util.Set;
  5.  
  6. public class CalcF {
  7.     private static final String BROKER_URL = "tcp://localhost:61616?jms.prefetchPolicy.all=1000";
  8.    
  9.     public static void main(String[] args) {
  10. /*     
  11.         String text = "Hello world";
  12.         BufferedWriter output = null;
  13.         try {
  14.             File file = new File("C:\\example.txt");
  15.             output = new BufferedWriter(new FileWriter(file));
  16.             output.write(text);
  17.         } catch ( IOException e ) {
  18.             e.printStackTrace();
  19.         } finally {
  20.           if ( output != null ) {
  21.             try {
  22.                 output.close();
  23.             } catch (IOException e) {
  24.                 // TODO Auto-generated catch block
  25.                 e.printStackTrace();
  26.             }
  27.           }
  28.         }*/
  29.        
  30.        
  31.         F Fconsumer = new F(BROKER_URL);
  32.         G Gconsumer = new G(BROKER_URL);
  33.         thread(Fconsumer, false);
  34.         thread(Gconsumer, false);
  35.        // System.out.print("dfsdf");
  36.     }
  37.    
  38.     public static void thread(Runnable runnable, boolean daemon)
  39.     {
  40.         Thread brokerThread = new Thread(runnable);
  41.         brokerThread.setDaemon(daemon);
  42.         brokerThread.start();
  43.     }
  44.  
  45. }
Add Comment
Please, Sign In to add comment