Package com.sun.messaging.jmq.io

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


            boolean takingoverCheck = (takeoverMsgs == null &&
                                 Globals.getHAEnabled() && haMonitor != null &&
                                 haMonitor.checkTakingoverDestination(this));
            s = new TreeSet(new RefCompare());
            while (msgs.hasMoreElements()) {
                Packet p = (Packet)msgs.nextElement();
                PacketReference pr =PacketReference.createReference(p, uid, null);
                if (takeoverMsgs != null && takeoverMsgs.contains(pr)) {
                    pr = null;
                    continue;
                }
View Full Code Here


    protected void sayGoodbye(int reason, String reasonstr) {
        sayGoodbye(false, reason, reasonstr);
    }
    protected void sayGoodbye(boolean force, int reason, String reasonStr) {
        Packet goodbye_pkt = new Packet(useDirectBuffers());
        goodbye_pkt.setPacketType(PacketType.GOODBYE);
        Hashtable hash = new Hashtable();
        hash.put("JMQExit", Boolean.valueOf(force));
        hash.put("JMQGoodbyeReason", new Integer(reason));
        hash.put("JMQGoodbyeReasonString", reasonStr);
        goodbye_pkt.setProperties(hash);
        sendControlMessage(goodbye_pkt);
    }
View Full Code Here

            }
        }


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

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

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

            /* Put implementation here! */
      Globals.getClusterBroadcast().reloadCluster();
  }

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

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

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

                assert false;
            }
        }

       // Send reply
       Packet reply = new Packet(con.useDirectBuffers());
       reply.setPacketType(PacketType.OBJECT_MESSAGE);
  
       setProperties(reply, MessageType.REPLACE_MESSAGE_REPLY,
           status, errMsg, newMsgIDHash);
  
       /*
 
View Full Code Here

                 logger.log(Logger.WARNING, msg);
             }
         }

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

       setProperties(reply, MessageType.UPDATE_CLUSTER_BROKERLIST_REPLY, status, msg);
         parent.sendReply(con, cmd_msg, reply);

         return true;
View Full Code Here

    public boolean handle(IMQConnection con, Packet cmd_msg,
               Hashtable cmd_props) {

  Integer n = (Integer)cmd_props.get(MessageType.JMQ_MESSAGE_TYPE);

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

  // By convention reply message is the message type + 1
  setProperties(reply, n.intValue() + 1, Status.ERROR, "Not Implemented");

  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.GET_CONNECTIONS_REPLY,
    status, errMsg);

  setBodyObject(reply, v);
View Full Code Here

  if ( DEBUG ) {
            logger.log(Logger.DEBUG, this.getClass().getName() + ": " +
                "Got Hello: " + cmd_props);
        }

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

  Hashtable props = new Hashtable();
  props.put(MessageType.JMQ_MESSAGE_TYPE,
      new Integer(MessageType.HELLO_REPLY));

  props.put(MessageType.JMQ_INSTANCE_NAME, Globals.getConfigName());
  props.put(MessageType.JMQ_STATUS, new Integer(Status.OK));
    
    try {
        if (cmd_msg.getDestination().equals(MessageType.JMQ_BRIDGE_ADMIN_DEST)) {

            BridgeServiceManager bsm = null;
            if (!Globals.bridgeEnabled()) {
                String emsg = rb.getKString(rb.W_BRIDGE_SERVICE_NOT_ENABLED);
                logger.log(Logger.WARNING, emsg);
              props.put(MessageType.JMQ_STATUS, new Integer(Status.UNAVAILABLE));
                props.put(MessageType.JMQ_ERROR_STRING, emsg);
            } else {
                bsm = Globals.getBridgeServiceManager();
                if (bsm == null || !bsm.isRunning()) {
                    String emsg = rb.getKString(rb.W_BRIDGE_SERVICE_MANAGER_NOT_RUNNING);
                    logger.log(Logger.WARNING, emsg);
                  props.put(MessageType.JMQ_STATUS, new Integer(Status.UNAVAILABLE));
                    props.put(MessageType.JMQ_ERROR_STRING, emsg);
                } else {
                    reply.setReplyTo(bsm.getAdminDestinationName());
                    reply.setReplyToClass(bsm.getAdminDestinationClassName());
                }
            }
        }
    } catch (Exception e) {
        String emsg = "XXXI18N in processing admin message: "+e.getMessage();
        logger.logStack(Logger.ERROR, emsg, e);
        props.put(MessageType.JMQ_STATUS, new Integer(Status.ERROR));
        props.put(MessageType.JMQ_ERROR_STRING, emsg);
    }
  reply.setProperties(props);

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

        throws IOException, BrokerException {

        int msgCount = dis.readInt(); // Number of msgs to process
        for (int i = 0; i < msgCount; i++) {
            // Reconstruct the message
            Packet pkt = new Packet(false);
            pkt.generateTimestamp(false);
            pkt.generateSequenceNumber(false);
            pkt.readPacket(dis);

            SysMessageID mid = pkt.getSysMessageID();

            // Make sure dst exists; autocreate if possible
            Destination dst = Destination.getDestination(
                pkt.getDestination(),
                pkt.getIsQueue() ? DestType.DEST_TYPE_QUEUE
                : DestType.DEST_TYPE_TOPIC, true, true);
            DestinationUID did = dst.getDestinationUID();

            // Load all msgs inorder to verify if any msgs are missing
            if (!dstLoadedSet.contains(dst)) {
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.