Examples of IResponseMaker


Examples of jifx.transactionManager.interfaces.IResponseMaker

   * system.
   */
  public void run() {
    ctx = new Context(message);
    IParticipant iParticipant;
    IResponseMaker iResponseMaker = null;
    IMessage iMessage;
    try {
      if (ti == null) {
        logger.error(transName+"|No se inicializó el Transaction Information|");
        return;
      }
      if (logger.isDebugEnabled())
        logger.debug(transName+"|Se inicia transacción:|" + ctx.getOriginalMessage());
     
      // Cargo la clase de respuesta
      iResponseMaker = (IResponseMaker) Class.forName(ti.getResponseClass().getClassName()).newInstance();
      iResponseMaker.setProperties(ti.getResponseClass().getProperties());
 
      // Cargo los participantes
      for (ParticipantResponseMakerInformation piPart : ti.getParticipants()) {
        try {
          iParticipant = (IParticipant)Class.forName(piPart.getClassName()).newInstance();
          iParticipant.setProperties(piPart.getProperties());
          partInit.add(iParticipant);
        } catch (Exception e) {
          logger.error(transName+"| No se encontró la clase de un participante: "+e.getMessage()+"|");
          return;
        }
      }
     
      ctx.put("TRANSACTION_NAME", transName);
     
      // Ejecuto la transacci�n
      boolean commited = false;     
      if (tmState==ConfiguratorMBean.TMState.ACTIVE) {
        boolean prep = prepare();
        if (prep) {
          commit();
          commited = true;
        } else
          rollback();
      }
      // Envio la respuesta.
      iMessage = iResponseMaker.makeResponse(ctx, commited);
      if (logger.isDebugEnabled() && iMessage != null){
        logger.debug(transName+"|Mensaje de respuesta: |" + iMessage);
      }
      // enviar el mensaje a la cola de Response
      if (iMessage != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.