Biblioteca Java - Rev 31
Subversion Repositories:
(root)/Frameworks and Technologies/TestActiveMQ2/src/main/java/com/linkscreens/activemq/protocol/EchoMessageProtocol.java
package com.linkscreens.activemq.protocol;
/**
* Returning back to client a echo message.
*/
public class EchoMessageProtocol extends MessageProtocol {
private long id;
EchoMessageProtocol() {
super(ProtocolType.ECHO);
}
public String handleProtocolMessage(String messageText) {
String responseText;
id++;
System.out.println("::: Processing message "+id+" with protocol "+this.getProtocolType());
responseText = "ECHO: "+messageText+" message count="+id;
return responseText;
}
}
/**
* Returning back to client a echo message.
*/
public class EchoMessageProtocol extends MessageProtocol {
private long id;
EchoMessageProtocol() {
super(ProtocolType.ECHO);
}
public String handleProtocolMessage(String messageText) {
String responseText;
id++;
System.out.println("::: Processing message "+id+" with protocol "+this.getProtocolType());
responseText = "ECHO: "+messageText+" message count="+id;
return responseText;
}
}