Package jifx.commons.messages

Examples of jifx.commons.messages.IMessage


  @Override
  public void messageReceived(IoSession session, Object message) {
    try {
      if (message != null) {
        IMessage im = (IMessage) message;
        MessageID msgId = new MessageID(messageIDInfo, im);
        registerSession(msgId, session);
        if (logger.isDebugEnabled())
          logger.debug(session.getAttachment()+"|Mensaje recibido: |"+message);
        server.messageProcessTM(im);
View Full Code Here



public class IFXProtocolEncoder implements ProtocolEncoder {

  public void encode(IoSession arg0, Object arg1, ProtocolEncoderOutput out) throws Exception {
    IMessage message = (IMessage) arg1;
        ByteBuffer buf = ByteBuffer.allocate(512);
        buf.setAutoExpand(true); // Enable auto-expand for easier encoding
       
        buf.put(message.toString().getBytes());
        buf.flip();
        out.write(buf);   
  }
View Full Code Here

  }

  @Override
  public void messageReceived(IoSession session, Object message) {
    try {
      IMessage im = (IMessage) message;
      im.setElement("BankSvcRq.DebitAddRq.MsgRqHdr.ClientTerminalSeqId", String.valueOf(numTransaction++));
      im.setElement("BankSvcRq.DebitAddRq.MsgRqHdr.NetworkTrnInfo.TerminalId", "22340");
     
      MessageID msgId = new MessageID(messageIDInfo, im);
      registerSession(msgId, session);
      if (logger.isDebugEnabled())
        logger.debug(session.getAttachment()+"|Mensaje recibido: |"+message);
View Full Code Here


public class IFXProtocolEncoder implements ProtocolEncoder {

  public void encode(IoSession arg0, Object arg1, ProtocolEncoderOutput out) throws Exception {
    IMessage message = (IMessage) arg1;
        Adapter adapter = new Adapter(out);
        ObjectOutputStream oos = new ObjectOutputStream(adapter);
        oos.writeObject(message.toString());
        oos.flush();
       
  }
View Full Code Here

      logger.debug(connectorISO.getChannelName()+"| Cliente conectado: "+session.getRemoteAddress()+"|");
   
  }

  public void messageReceived(IoSession session, Object message) {
    IMessage im = (IMessage) message;
    if (logger.isDebugEnabled())
      logger.debug(connectorISO.getChannelName()+"|Mensaje recibido: |"+message);
    connectorISO.messageProcessTM(im);
  }
View Full Code Here

public class ISOProtocolEncoder implements ProtocolEncoder {


  public void encode(IoSession arg0, Object arg1, ProtocolEncoderOutput out) throws Exception {
    IMessage message = (IMessage) arg1;
        ByteBuffer buf = ByteBuffer.allocate(512);
        buf.setAutoExpand(true); // Enable auto-expand for easier encoding
       
        buf.put((message.toString()+"\r\n").getBytes());
        buf.flip();
        out.write(buf);   
  }
View Full Code Here

  static Logger logger = Logger.getLogger(Transaction.class);

  private Map<String, String> properties;

  public IMessage makeResponse(Context ctx, boolean commited) {
    IMessage msg = (IMessage) ctx.get("RESPONSE");
    return msg;
  }
View Full Code Here

import jifx.transactionManager.transaction.Context;

public class AutorizadorResponse extends AbstractResponse {

  public IMessage makeResponse(Context ctx, boolean commited) {
     IMessage resPOS = (IMessage) ctx.get("responsePOS");
    return resPOS;
  }
View Full Code Here

  public void commit(Context ctx) {
  }

  public void prepare(Context ctx) throws ParticipantException, ValidatorException {
      try {
        IMessage msg = ctx.getOriginalMessage();
        ILink link = LinkFactory.getFactory().getLinkChannel(properties.get("link"));
        IMessage res = link.sendReceiveMessage(msg);
        ctx.put("RESPONSE", res);
      } catch (ComunicationException e) {
        e.printStackTrace();
      }
  }
View Full Code Here

  private Map<String, String> properties;
 
  public IMessage makeResponse(Context ctx, boolean commited) {
      if (commited) {
    IMessage msgResAut = (IMessage) ctx.get("RESPONSE");
    return msgResAut;
   
//    Object tmp = ctx.get("BankSvcRq.DebitAddRq.MsgRqHdr.ClientTerminalSeqId");
//    if (tmp != null) {
//        IMessage msg = IFXMessageFactory.createMessageDebitResponse(tmp.toString().replace('\n', ' ').trim());
View Full Code Here

TOP

Related Classes of jifx.commons.messages.IMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.