source: trunk/src/test/java/multiThreadTest/MobileThread.java @ 44

Last change on this file since 44 was 44, checked in by stoda, 11 years ago

Objectmq converted to maven project

File size: 546 bytes
Line 
1package multiThreadTest;
2
3import omq.common.broker.Broker;
4
5public class MobileThread extends Thread {
6        private String name;
7        private Object lock;
8
9        public MobileThread(String name, Object lock) {
10                this.name = name;
11                this.lock = lock;
12        }
13
14        @Override
15        public void run() {
16                try {
17                        Mobile mobile = (Mobile) Broker.lookup(name, Mobile.class);
18                        synchronized (lock) {
19                                mobile.sendMessage("Hello this is Sergi");
20                                mobile.sendMessage("and this is a test");
21                                Thread.sleep(1000);
22                                lock.notify();
23                        }
24                } catch (Exception e) {
25
26                }
27        }
28}
Note: See TracBrowser for help on using the repository browser.