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

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


    orb.initORB(new String[] {}, null);

    try {
      oa.initOA();
    } catch (Throwable t) {
      throw new ConnectionException(Connection.TPESYSTEM,
          "Could not connect to the orb", t);
    }
    ORBManager.setORB(orb);
    ORBManager.setPOA(oa);
View Full Code Here


        this.serviceData.put(serviceName, data);
        log.info("Advertised: " + serviceName);
      } catch (ConnectionException e) {
        throw e;
      } catch (Throwable t) {
        throw new ConnectionException(Connection.TPESYSTEM,
            "Could not create service factory for: " + serviceName,
            t);
      }
    } else if (!serviceData.getServiceClassName().equals(serviceClassName)) {
      throw new ConnectionException(Connection.TPEMATCH,
          "Service already registered");
    } else {
      log.trace("This is a duplicate advertise");
    }
  }
View Full Code Here

        0,
        Math.min(Connection.XATMI_SERVICE_NAME_LENGTH,
            serviceName.length()));
    ServiceData data = serviceData.remove(serviceName);
    if (data == null) {
      throw new ConnectionException(Connection.TPENOENT,
          "Service did not exist: " + serviceName);
    }
    data.close();
  }
View Full Code Here

      int len, int correlationId, int flags, int ttl, String type,
      String subtype) throws ConnectionException {
    log.debug("Sending the message");
    if (closed) {
      log.error("Sender closed");
      throw new ConnectionException(Connection.TPEPROTO, "Sender closed");
    }
    if (data == null) {
      data = new byte[1];
      len = 1;
    }
    String toReplyTo = (String) replyTo;
    if (toReplyTo == null) {
      log.trace("Reply to set as null");
      toReplyTo = "";
    }
    if (type == null) {
      log.trace("Type set as null");
      type = "";
    }
    if (subtype == null) {
      log.trace("Subtype set as null");
      subtype = "";
    }
    if (len < 1) {
      log.error("Length of buffer must be greater than 0");
      throw new ConnectionException(Connection.TPEINVAL,
          "Length of buffer must be greater than 0");
    }
    byte[] toSend = new byte[len + pad];
    if (data != null) {
      int min = Math.min(toSend.length, data.length);
View Full Code Here

      File file = new File(xsdFilename);
      if (file.exists()) {
        schema = schemaFactory.newSchema(file);
      } else {
        throw new ConnectionException(Connection.TPEOS,
              "Could not find " + xsdFilename);
      }
     
      factory.setSchema(schema);
      saxParser = factory.newSAXParser();
      PSVIProvider p = (PSVIProvider) saxParser.getXMLReader();
     
      handler = new NestedBufferHandlers(p);

    }catch (SAXException e) {
      log.error("Could not create a SAXParser: " + e.getMessage(), e);
      throw new ConnectionException(Connection.TPEOS,
            "Could not create a SAXParser: " + e.getMessage());
    } catch (ParserConfigurationException e) {
      log.error("Could not create a SAXParser: " + e.getMessage(), e);
      throw new ConnectionException(Connection.TPEOS,
            "Could not create a SAXParser: " + e.getMessage());
    } catch (Throwable e) {
      log.error("Could not create a SAXParser: " + e.getMessage(), e);
      throw new ConnectionException(Connection.TPEOS,
            "Could not create a SAXParser: " + e.getMessage());
    }
  }
View Full Code Here

          new ByteArrayInputStream(buffer)));
      saxParser.parse(new ByteArrayInputStream(buffer), handler);
      result = true;
    } catch (Throwable e) {
      log.error("Parser buffer failed with " + e.getMessage(), e);
      throw new ConnectionException(Connection.TPEOS,
          "Parser buffer failed with " + e.getMessage());
    }
   
    return result;
  }
View Full Code Here

      BytesMessage bytesMessage = ((BytesMessage) message);
      org.jboss.narayana.blacktie.jatmibroker.core.transport.Message toProcess = convertFromBytesMessage(bytesMessage);
      log.debug("SERVER onMessage: transaction control ior: "
          + toProcess.control);
      if (JtsTransactionImple.hasTransaction()) {
        throw new ConnectionException(Connection.TPEPROTO,
            "Blacktie MDBs must not be called with a transactional context");
      }
      processMessage(serviceName, toProcess);
      log.debug("Processed message");
    } catch (Throwable t) {
View Full Code Here

    management.send(message, outputStream);
    org.jboss.narayana.blacktie.jatmibroker.core.transport.hybrid.stomp.Message receive = management
        .receive(inputStream);
    if (receive.getCommand().equals("ERROR")) {
      log.error(new String(receive.getBody()));
      throw new ConnectionException(Connection.TPENOENT, new String(
          receive.getBody()));
    } else if (receive.getCommand().equals("MESSAGE")) {
      // TODO remove when moving to HQStomp
      log.trace("Received a message rather than a receipt");
      this.pendingMessage = receive;
View Full Code Here

          receive = management.receive(inputStream);
        }
        log.debug("Received from: " + destinationName);
      }
      if (!receive.getCommand().equals("MESSAGE")) {
        throw new ConnectionException(Connection.TPESYSTEM,
            "Internal error, received unexpected receipt");
      }
      Message convertFromBytesMessage = convertFromBytesMessage(receive);
      convertFromBytesMessage.setManagement(management);
      convertFromBytesMessage.setOutputStream(outputStream);
      convertFromBytesMessage.setMessageId(receive.getHeaders().get(
          "message-id"));
      log.debug("Returning message from: " + destinationName);
      return convertFromBytesMessage;
    } catch (ConnectionException e) {
      throw e;
    } catch (Exception t) {
      log.debug("Couldn't receive the message: " + t.getMessage(), t);
      throw new ConnectionException(Connection.TPESYSTEM,
          "Couldn't receive the message", t);
    }
  }
View Full Code Here

  }

  public void close() throws ConnectionException {
    log.debug("close");
    if (closed) {
      throw new ConnectionException(Connection.TPEPROTO,
          "Sender already closed");
    }
    try {
      log.debug("closing socket: " + socket);
      socket.close();
      log.debug("closed socket: " + socket);
      closed = true;
    } catch (Throwable t) {
      log.debug("consumer could not be closed");
      throw new ConnectionException(Connection.TPESYSTEM,
          "Could not delete the queue", t);
    }
  }
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.