Package org.jboss.narayana.blacktie.jatmibroker.xatmi

Examples of org.jboss.narayana.blacktie.jatmibroker.xatmi.ConnectionException


      String command = "serverdone";
      boolean shutdown = false;
      try {
        if (id == 0) {
          List<Integer> ids = listRunningInstanceIds(serverName);
                    ConnectionException toRethrow = null;
          for (int i = 0; i < ids.size(); i++) {
                        try {
                callAdminService(serverName, ids.get(i), command);
                  } catch (ConnectionException e) {
                    log.error("call server " + serverName + " id " + id
View Full Code Here


  }

  public void close() throws ConnectionException {
    log.debug("Close called");
    if (closed) {
      throw new ConnectionException(Connection.TPEPROTO,
          "Sender already closed");
    }
    closed = true;
    log.debug("Sender closed: " + name);
  }
View Full Code Here

  public Sender getSender(String serviceName, boolean conversational)
      throws ConnectionException {
    if (closed) {
      log.error("Already closed");
      throw new ConnectionException(Connection.TPEPROTO, "Already closed");
    }
    log.debug("Get sender: " + serviceName);
    Map<String, Sender> conversationalMap = senders.get(conversational);
    if (conversationalMap == null) {
      conversationalMap = new HashMap<String, Sender>();
      senders.put(conversational, conversationalMap);
    }

    Sender toReturn = conversationalMap.get(serviceName);
    if (toReturn == null) {
      try {
        String type = (String) properties.get(
            "blacktie." + serviceName + ".type");
        toReturn = new StompSenderImpl(momManagement, serviceName,
            conversational, type, conversationalMap);
        conversationalMap.put(serviceName, toReturn);
      } catch (ConnectionException e) {
        throw e;
      } catch (Throwable t) {
        throw new ConnectionException(
            org.jboss.narayana.blacktie.jatmibroker.xatmi.Connection.TPESYSTEM,
            "Could not create a service sender: " + t.getMessage(),
            t);
      }
    }
View Full Code Here

  }

  public Sender createSender(Object destination) throws ConnectionException {
    if (closed) {
      log.error("Already closed");
      throw new ConnectionException(Connection.TPEPROTO, "Already closed");
    }
    String callback_ior = (String) destination;
    log.debug("Creating a sender for: " + callback_ior);
    org.omg.CORBA.Object serviceFactoryObject = orbManagement.getOrb()
        .string_to_object(callback_ior);
View Full Code Here

  public Receiver getReceiver(String serviceName, boolean conversational)
      throws ConnectionException {
    if (closed) {
      log.error("Already closed");
      throw new ConnectionException(Connection.TPEPROTO, "Already closed");
    }
    log.debug("Creating a receiver: " + serviceName);
    Map<String, Receiver> conversationalMap = receivers.get(conversational);
    if (conversationalMap == null) {
      conversationalMap = new HashMap<String, Receiver>();
      receivers.put(conversational, conversationalMap);
    }

    Receiver toReturn = conversationalMap.get(serviceName);
    if (toReturn == null) {
      try {
        log.debug("Resolved destination");
        String type = (String) properties.get(
            "blacktie." + serviceName + ".type");
        return new StompReceiverImpl(momManagement, serviceName,
            conversational, type, properties);
      } catch (ConnectionException e) {
        throw e;
      } catch (Throwable t) {
        throw new ConnectionException(
            org.jboss.narayana.blacktie.jatmibroker.xatmi.Connection.TPESYSTEM,
            "Could not create the receiver on: " + serviceName, t);
      }
    }
    return toReturn;
View Full Code Here

  public Receiver createReceiver(int cd, ResponseMonitor responseMonitor)
      throws ConnectionException {
    if (closed) {
      log.error("Already closed");
      throw new ConnectionException(Connection.TPEPROTO, "Already closed");
    }
    log.debug("Creating a receiver");
    return new CorbaReceiverImpl(orbManagement, properties, cd,
        responseMonitor);
  }
View Full Code Here

  public Receiver createReceiver(EventListener eventListener)
      throws ConnectionException {
    if (closed) {
      log.error("Already closed");
      throw new ConnectionException(Connection.TPEPROTO, "Already closed");
    }
    log.debug("Creating a receiver with event listener");
    return new CorbaReceiverImpl(eventListener, orbManagement, properties);
  }
View Full Code Here

          .narrow(tmp_ref);
      log.debug("narrowed reference " + clientCallback);
      callbackIOR = orb.object_to_string(clientCallback);
      log.debug("Created:" + callbackIOR);
    } catch (Throwable t) {
      throw new ConnectionException(Connection.TPESYSTEM,
          "Cannot create the receiver", t);
    }
    timeout = Integer.parseInt(properties.getProperty("ReceiveTimeout"))
        * 1000 + Integer.parseInt(properties.getProperty("TimeToLive"))
        * 1000;
 
View Full Code Here

      } else {
        log.debug("Not waiting for the response, hope its there!");
      }
      if (returnData.isEmpty()
          && (flags & Connection.TPNOBLOCK) == Connection.TPNOBLOCK) {
        throw new ConnectionException(Connection.TPEBLOCK,
            "Did not receive a message");
      } else if (returnData.isEmpty()) {
        log.debug("Empty return data: " + callbackIOR);
        if (JtsTransactionImple.hasTransaction()) {
          try {
            log.debug("Marking rollbackOnly");
            JABTransaction.current().rollback_only();
          } catch (JABException e) {
            throw new ConnectionException(Connection.TPESYSTEM,
                "Could not mark transaction for rollback only");
          }
        }
        throw new ConnectionException(Connection.TPETIME,
            "Did not receive a message");
      } else {
        Message message = returnData.remove(0);
        if (message != null) {
          log.debug("Message was available");
          if (message.rval == EventListener.DISCON_CODE) {
            if (JABTransaction.current() != null) {
              try {
                log.debug("Marking rollbackOnly as disconnection");
                JABTransaction.current().rollback_only();
              } catch (JABException e) {
                throw new ConnectionException(
                    Connection.TPESYSTEM,
                    "Could not mark transaction for rollback only");
              }
            }
          } else if (message.rcode == Connection.TPESVCERR) {
            if (JABTransaction.current() != null) {
              try {
                log.debug("Marking rollbackOnly as svc err");
                JABTransaction.current().rollback_only();
              } catch (JABException e) {
                throw new ConnectionException(
                    Connection.TPESYSTEM,
                    "Could not mark transaction for rollback only");
              }
            }
          } else if (message.rval == Connection.TPFAIL) {
            if (JABTransaction.current() != null) {
              try {
                JABTransaction.current().rollback_only();
              } catch (JABException e) {
                throw new ConnectionException(
                    Connection.TPESYSTEM,
                    "Could not mark transaction for rollback only");
              }
            }
          }
View Full Code Here

  }

  public void close() throws ConnectionException {
    log.debug("close: " + callbackIOR);
    if (closed) {
      throw new ConnectionException(Connection.TPEPROTO,
          "Sender already closed");
    }
    disconnect();
    closed = true;
  }
View Full Code Here

TOP

Related Classes of org.jboss.narayana.blacktie.jatmibroker.xatmi.ConnectionException

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.