Advertisement
Guest User

g

a guest
Jun 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. package broker.model;
  2.  
  3. import approval.model.ApprovalReply;
  4. import client.model.MessageReceiverGateway;
  5. import client.model.MessageSenderGateway;
  6. import client.model.TravelRefundReply;
  7. import client.model.TravelRefundRequest;
  8. import net.sourceforge.jeval.EvaluationException;
  9. import javax.jms.JMSException;
  10. import java.io.IOException;
  11.  
  12.  
  13.  
  14.  
  15. public abstract class ClientAppGateway {
  16. protected MessageSenderGateway sender;
  17. protected MessageReceiverGateway receiver;
  18. protected Serializer serializer;
  19.  
  20. protected ClientAppGateway(String queueNameSend, String queueNameReceive){
  21. sender = new MessageSenderGateway(queueNameSend);
  22. receiver = new MessageReceiverGateway(queueNameReceive);
  23. serializer = new Serializer();
  24. }
  25.  
  26. //used to perform some actions when a TravelRefundRequest is arrived
  27. public abstract void onTravelRefundRequestArrivedToBroker(TravelRefundRequest travelRefundRequest) throws JMSException, IOException, EvaluationException;
  28.  
  29. //used to perform some actions when an ApprovalReply is arrived
  30. public abstract void onApprovalReplyArrivedToBroker(ApprovalReply approvalReply) throws JMSException, EvaluationException;
  31.  
  32. //send a TravelRefundReply
  33. public abstract void sendTravelRefundReply(TravelRefundReply travelRefundReply) throws JMSException;
  34.  
  35. //listen for messages
  36. public abstract void receiverSetListener() throws JMSException;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement