source: branches/objectmq-1.0/src/omq/ztest/calculator/CalculatorImpl.java @ 33

Last change on this file since 33 was 33, checked in by amoreno, 11 years ago

new release version

File size: 987 bytes
Line 
1package omq.ztest.calculator;
2
3import java.io.IOException;
4
5import omq.client.annotation.AsyncMethod;
6import omq.common.broker.Broker;
7import omq.exception.SerializerException;
8import omq.server.remote.request.RemoteObject;
9
10public class CalculatorImpl extends RemoteObject implements Calculator {
11        private int mult = 0;
12
13        public CalculatorImpl() throws Exception {
14                super();
15        }
16
17        private static final long serialVersionUID = 1L;
18
19        public int add(int x, int y) {
20                return x + y;
21        }
22
23        public void mult(int x, int y) {
24                mult = x * y;
25        }
26
27        public int getMult() {
28                return mult;
29        }
30
31        public void setMult(int mult) {
32                this.mult = mult;
33        }
34
35        public void divideByZero() throws IOException, SerializerException {
36                ZeroEvent ze = new ZeroEvent("my zero event", "zero-event");
37                Broker.trigger(ze);
38                //notifyEvent(ze);
39        }
40
41        @Override
42        @AsyncMethod
43        public void sendMessage(Message m) {
44                System.out.println("Code = "+m.getCode());
45                System.out.println("Message = "+m.getMessage());
46        }
47       
48       
49
50}
Note: See TracBrowser for help on using the repository browser.