- Timestamp:
- 05/22/13 18:41:56 (11 years ago)
- Location:
- trunk/objectmq/src/omq
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/objectmq/src/omq/common/event/EventWrapper.java
r16 r17 1 1 package omq.common.event; 2 2 3 public class EventWrapper { 3 import java.io.Serializable; 4 5 public class EventWrapper implements Serializable { 6 7 /** 8 * 9 */ 10 private static final long serialVersionUID = 1L; 11 4 12 private String type; 5 13 private Event event; … … 8 16 } 9 17 10 // TODO change to simpleName18 // TODO change to simpleName 11 19 public EventWrapper(Event event) { 12 20 this.event = event; -
trunk/objectmq/src/omq/common/util/Serializers/JavaImp.java
r14 r17 7 7 8 8 import omq.common.event.Event; 9 import omq.common.event.EventWrapper; 9 10 import omq.common.message.Request; 10 11 import omq.common.message.Response; … … 54 55 @Override 55 56 public Event deserializeEvent(byte[] bytes) throws SerializerException { 56 return (Event) deserliazeObject(bytes); 57 EventWrapper wrapper = (EventWrapper) deserliazeObject(bytes); 58 return wrapper.getEvent(); 57 59 } 58 60 -
trunk/objectmq/src/omq/ztest/calculator/Calculator.java
r16 r17 16 16 @AsyncMethod 17 17 public void mult(int x, int y); 18 18 19 @AsyncMethod 20 public void sendMessage(Message m); 21 19 22 @AsyncMethod 20 23 public void divideByZero() throws IOException, SerializerException; -
trunk/objectmq/src/omq/ztest/calculator/CalculatorImpl.java
r16 r17 3 3 import java.io.IOException; 4 4 5 import omq.client.annotation.AsyncMethod; 5 6 import omq.exception.SerializerException; 6 7 import omq.server.remote.request.RemoteObject; … … 36 37 } 37 38 39 @Override 40 @AsyncMethod 41 public void sendMessage(Message m) { 42 System.out.println("Code = "+m.getCode()); 43 System.out.println("Message = "+m.getMessage()); 44 } 45 46 47 38 48 } -
trunk/objectmq/src/omq/ztest/calculator/CalculatorTest.java
r16 r17 24 24 env.setProperty(ParameterQueue.SERVER_HOST, "127.0.0.1"); 25 25 env.setProperty(ParameterQueue.SERVER_PORT, "5672"); 26 // env.setProperty(ParameterQueue.SERIALIZERNAME, "omq.common.util.Serializers.KryoImp"); 26 // env.setProperty(ParameterQueue.SERIALIZERNAME, 27 // "omq.common.util.Serializers.KryoImp"); 27 28 env.setProperty(ParameterQueue.SERIALIZERNAME, "omq.common.util.Serializers.GsonImp"); 28 29 env.setProperty(ParameterQueue.ENABLECOMPRESSION, "false"); … … 82 83 Thread.sleep(200); 83 84 } 85 86 @Test 87 public void sendMessage() throws Exception { 88 Message m = new Message(2334, "Hello objectmq"); 89 remoteCalc.sendMessage(m); 90 } 84 91 } -
trunk/objectmq/src/omq/ztest/calculator/ServerTest.java
r16 r17 32 32 Broker.bind("calculator1", calc); 33 33 Broker.bind("calculator2", calc2); 34 35 System.out.println("Server started"); 34 36 } 35 37 }
Note: See TracChangeset
for help on using the changeset viewer.