Package org.jboss.blacktie.jatmibroker.core.transport

Examples of org.jboss.blacktie.jatmibroker.core.transport.Receiver


    synchronized (this) {
      correlationId = ++nextId;
      log.trace("Allocated next sessionId: " + correlationId);
    }
    Transport transport = getTransport(svc);
    Receiver endpoint = transport.createReceiver(correlationId,
        responseMonitor);
    temporaryQueues.put(correlationId, endpoint);
    log.trace("Added a queue for: " + correlationId);
    // TODO HANDLE TRANSACTION
    String type = null;
    String subtype = null;
    int len = 0;
    byte[] data = null;
    if (toSend != null) {
      data = toSend.serialize();
      type = toSend.getType();
      subtype = toSend.getSubtype();
      len = toSend.getLen();
    }

    String timeToLive = properties.getProperty("TimeToLive");
    int ttl = 0;

    if (timeToLive != null) {
      ttl = Integer.parseInt(timeToLive) * 1000;
    }
    transport.getSender(svc, false).send(endpoint.getReplyTo(), (short) 0,
        0, data, len, correlationId, flags, ttl, type, subtype);
    if ((flags & Connection.TPNOREPLY) == Connection.TPNOREPLY) {
      correlationId = 0;
    }
    log.debug("Returning cd: " + correlationId);
View Full Code Here


   *             If the client cannot be cleaned up.
   */
  public int tpcancel(int cd) throws ConnectionException {
    log.debug("tpcancel: " + cd);
    int toReturn = -1;
    Receiver endpoint = temporaryQueues.remove(cd);
    if (endpoint != null) {
      log.debug("closing endpoint");
      endpoint.close();
      log.debug("endpoint closed");
      toReturn = 0;
    } else {
      log.debug("No endpoint available");
      throw new ConnectionException(Connection.TPEBADDESC, "cd " + cd
View Full Code Here

      correlationId = nextId++;
    }
    Transport transport = getTransport(svc);
    Session session = new Session(this, svc, transport, correlationId);

    Receiver receiver = session.getReceiver();
    // TODO HANDLE TRANSACTION
    String type = null;
    String subtype = null;
    int len = 0;
    byte[] data = null;
    if (toSend != null) {
      data = toSend.serialize();
      type = toSend.getType();
      subtype = toSend.getSubtype();
      len = toSend.getLen();
    }

    String timeToLive = properties.getProperty("TimeToLive");
    int ttl = 0;

    if (timeToLive != null) {
      ttl = Integer.parseInt(timeToLive) * 1000;
    }
    log.debug("tpconnect sending data");
    session.getSender().send(receiver.getReplyTo(), (short) 0, 0, data,
        len, correlationId, flags | TPCONV, ttl, type, subtype);

    byte[] response = null;
    try {
      log.debug("tpconnect receiving data");
View Full Code Here

   * @throws ConnectionException
   *             If the response cannot be retrieved.
   */
  private Response receive(int cd, int flags) throws ConnectionException {
    log.debug("receive: " + cd);
    Receiver endpoint = temporaryQueues.get(cd);
    if (endpoint == null) {
      throw new ConnectionException(Connection.TPEBADDESC,
          "Session does not exist: " + cd);
    }
    Message message = endpoint.receive(flags);
    temporaryQueues.remove(cd);
    Buffer buffer = null;
    if (message.type != null && !message.type.equals("")) {
      buffer = tpalloc(message.type, message.subtype, message.len);
      buffer.deserialize(message.data);
View Full Code Here

TOP

Related Classes of org.jboss.blacktie.jatmibroker.core.transport.Receiver

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.