Changeset 67 for trunk/src/test
- Timestamp:
- 06/27/13 11:44:54 (11 years ago)
- Location:
- trunk/src/test/java/omq/test/event
- Files:
-
- 1 added
- 2 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/test/java/omq/test/event/EventTrigger.java
r66 r67 1 1 package omq.test.event; 2 2 3 import java.io.IOException; 4 3 5 import omq.Remote; 6 import omq.client.annotation.AsyncMethod; 4 7 import omq.client.annotation.RemoteInterface; 8 import omq.exception.SerializerException; 5 9 6 10 @RemoteInterface 7 11 public interface EventTrigger extends Remote { 8 12 @AsyncMethod 13 public void triggerEvent(String message) throws IOException, SerializerException; 9 14 } -
trunk/src/test/java/omq/test/event/EventTriggerImpl.java
r66 r67 1 1 package omq.test.event; 2 2 3 import java.io.IOException; 4 5 import omq.exception.SerializerException; 3 6 import omq.server.RemoteObject; 4 7 … … 9 12 */ 10 13 private static final long serialVersionUID = 1L; 14 15 public void triggerEvent(String message) throws IOException, SerializerException { 16 MessageEvent event = new MessageEvent(message); 17 this.notifyEvent(event); 18 } 11 19 12 20 } -
trunk/src/test/java/omq/test/event/MessageEvent.java
r66 r67 3 3 import omq.common.event.Event; 4 4 5 public class ZeroEvent extends Event {5 public class MessageEvent extends Event { 6 6 /** 7 7 * … … 9 9 private static final long serialVersionUID = 1L; 10 10 11 public ZeroEvent() { 11 private String message; 12 13 public MessageEvent() { 12 14 } 13 15 14 public ZeroEvent(String corrId, String topic) {15 super(corrId, topic);16 public MessageEvent(String message) { 17 this.message = message; 16 18 } 17 19 18 public String getZeroMessage() { 19 return "divition by 0"; 20 public String getMessage() { 21 return message; 22 } 23 24 public void setMessage(String message) { 25 this.message = message; 20 26 } 21 27 -
trunk/src/test/java/omq/test/event/MessageListener.java
r66 r67 3 3 import omq.common.event.EventListener; 4 4 5 public class ZeroListener extends EventListener<ZeroEvent> { 5 public class MessageListener extends EventListener<MessageEvent> { 6 private String message; 6 7 7 public ZeroListener(String topic) { 8 super(topic); 8 @Override 9 public void notifyEvent(MessageEvent event) { 10 message = event.getMessage(); 9 11 } 10 12 11 @Override 12 public void notifyEvent(ZeroEvent event) { 13 System.out.println(event.getZeroMessage()); 13 public String getMessage() { 14 return message; 15 } 16 17 public void setMessage(String message) { 18 this.message = message; 14 19 } 15 20 }
Note: See TracChangeset
for help on using the changeset viewer.