Package com.sun.messaging.jmq.io

Examples of com.sun.messaging.jmq.io.Packet


    }
  }
 
  public void readWork(DataInputStream dis) throws IOException,
      BrokerException {
    message = new Packet(false);
    message.generateTimestamp(false);
    message.generateSequenceNumber(false);
    message.readPacket(dis);

    int numStoredInterests = dis.readInt();
View Full Code Here


        Hashtable hm = new Hashtable();
        hm.put("JMQSize", rfs.size);
        hm.put("JMQBytes", new Long(rfs.bytes));
        hm.put("JMQMaxMsgBytes", new Long(rfs.mbytes));
        if (con != null) {
            Packet pkt = new Packet(con.useDirectBuffers());
            pkt.setPacketType(PacketType.RESUME_FLOW);
            hm.put("JMQProducerID", new Long(getProducerUID().longValue()));
            hm.put("JMQDestinationID", duid.toString());
            hm.put("Reason", reason);
            pkt.setProperties(hm);
            con.sendControlMessage(pkt);
        }
    }
View Full Code Here

            status = Status.NOT_FOUND;
      errMsg = rb.getString(rb.X_NO_SUCH_SERVICE, service);
        }

        // Write reply
  Packet reply = new Packet(con.useDirectBuffers());
  reply.setPacketType(PacketType.OBJECT_MESSAGE);

  setProperties(reply, MessageType.GET_SERVICES_REPLY, status, errMsg);

  setBodyObject(reply, v);
View Full Code Here

    public void sendReply(IMQConnection con, Packet msg, int type,
                int status, long tid, String reason, BrokerException bex, long nextTid)
    {
         if (fi.FAULT_INJECTION)
            checkFIAfterProcess(msg.getPacketType());
          Packet pkt = new Packet(con.useDirectBuffers());
          pkt.setPacketType(type);
          pkt.setConsumerID(msg.getConsumerID());
          Hashtable hash = new Hashtable();
          hash.put("JMQStatus", new Integer(status));
          if (reason != null)
              hash.put("JMQReason", reason);
          if (tid != 0) {
            hash.put("JMQTransactionID", new Long(tid));
          }
          if (bex != null && bex.isRemote()) {
            hash.put("JMQRemote", Boolean.valueOf(true));
            if (bex.getRemoteConsumerUIDs() != null) {
            hash.put("JMQRemoteConsumerIDs", bex.getRemoteConsumerUIDs());
            }
          }
          if(nextTid!=0)
            hash.put("JMQNextTransactionID", new Long(nextTid));

        
          pkt.setProperties ( hash );
        con.sendControlMessage(pkt);
          if (fi.FAULT_INJECTION)
            checkFIAfterReply(msg.getPacketType());
    }
View Full Code Here

    /**
     * Send a reply packet with a body and properties
     */
    public void sendReplyBody(IMQConnection con, Packet msg, int type, int status, Hashtable hash, byte[] body)
    {
          Packet pkt = new Packet(con.useDirectBuffers());
          pkt.setPacketType(type);
          pkt.setConsumerID(msg.getConsumerID());

          if (hash == null) {
            hash = new Hashtable();
          }
          hash.put("JMQStatus", new Integer(status));
          if (((IMQBasicConnection)con).getDumpPacket() ||
                ((IMQBasicConnection)con).getDumpOutPacket())
              hash.put("JMQReqID", msg.getSysMessageID().toString());

          pkt.setProperties ( hash );

          if (body != null) {
            pkt.setMessageBody(body);
          }
    con.sendControlMessage(pkt);
    }
View Full Code Here

             
                if (Globals.getClusterBroadcast().getClusterVersion() <
                                            ClusterBroadcast.VERSION_410) {
                    return null;
                }
                Packet p = new Packet();
                try {
                p.fill(msg);
                } catch (IOException e) {
                logger.logStack(Logger.INFO,"Internal Exception processing packet ", e);
                throw new BrokerException(e.getMessage(), e);
                }
                p.setPacketType(PacketType.PREPARE_TRANSACTION);
                if (ts.getState() == TransactionState.STARTED && ts.getXid() == null) {
                    ts.setState(TransactionState.COMPLETE);
                    xaFlags = new Integer(XAResource.TMNOFLAGS);
                }
                baseTransaction = doPrepare(id, xaFlags, ts, p.getPacketType(), true, txnWork);
            }
        }
        return baseTransaction;
    }
View Full Code Here

            }
            if (list == null) list = "";
            brokerProps.put("imq.cluster.brokerlist.active", list);

  // Send reply
  Packet reply = new Packet(con.useDirectBuffers());
  reply.setPacketType(PacketType.OBJECT_MESSAGE);

  setProperties(reply, MessageType.GET_BROKER_PROPS_REPLY,
    status, msg);

  setBodyObject(reply, brokerProps);
View Full Code Here

            status = Status.NOT_FOUND;
      errMsg = rb.getString(rb.E_NO_SUCH_TRANSACTION, tid);
        }

        // Write reply
  Packet reply = new Packet(con.useDirectBuffers());
  reply.setPacketType(PacketType.OBJECT_MESSAGE);

  setProperties(reply, MessageType.GET_TRANSACTIONS_REPLY, status, errMsg);
        // Add JMQQuantity property
        try {
            reply.getProperties().put(MessageType.JMQ_QUANTITY,
                            new Integer(v.size()));
        } catch (IOException e) {
      // Programming error. No need to I18N
      logger.log(Logger.WARNING, rb.E_INTERNAL_BROKER_ERROR,
                "Admin: GetTransactions: Could not extract properties from pkt",
View Full Code Here

                assert false;
            }
        }

       // Send reply
       Packet reply = new Packet(con.useDirectBuffers());
       reply.setPacketType(PacketType.OBJECT_MESSAGE);
  
       setProperties(reply, MessageType.DELETE_MESSAGE_REPLY,
           status, errMsg);
  
       parent.sendReply(con, cmd_msg, reply);
View Full Code Here

  }

  }

  // Send reply
  Packet reply = new Packet(con.useDirectBuffers());
  reply.setPacketType(PacketType.OBJECT_MESSAGE);

  setProperties(reply, MessageType.UPDATE_BROKER_PROPS_REPLY,
    status, msg);

  parent.sendReply(con, cmd_msg, reply);
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.io.Packet

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.