Package com.sun.messaging.jmq.jmsserver.core

Examples of com.sun.messaging.jmq.jmsserver.core.Destination


      logger.log(Logger.DEBUG,
          " handleSentMessages: duid= "+duid);
           
      PacketReference pr = PacketReference.createReference(packet, duid,
          null);
      Destination d = Destination.getDestination(duid);
      if (d == null) {
        // Could be an auto-created dest that was reaped on load.
        // Lets recreate it here.
        try {
          int type = (duid.isQueue() ? DestType.DEST_TYPE_QUEUE
              : DestType.DEST_TYPE_TOPIC);
          d = Destination.getDestination(duid.getName(), type, true,
              true);
        } catch (IOException e) {
          throw new BrokerException("Could not recreate destination "
              + duid, e);
        }
      }
     
      // check it is loaded
      d.load();
     
      logger.log(Logger.DEBUG,
          " loadTransactions: processing prepared sent message "
              + packet.getMessageID()) ;

      // queue message
      boolean result = d.queueMessage(pr, true);

      // store (should not really be persisted as we are using txnLog)
      // pr.store();

      // add message to transaction
View Full Code Here


      ConsumerUID consumerID) throws BrokerException {
    logger.log(Logger.DEBUG,
        " trying to unroute prepared acknowledged message: destID =  "
            + destID + " ackedMsgId=" + ackedSysMsgID);
   
    Destination dest = null;
    PacketReference ackedMessage = null;
    if (destID != null) {
      dest = Destination.getDestination(destID);
      if (dest != null) {
        dest.load();
        ackedMessage = dest.getMessage(ackedSysMsgID);
        if (ackedMessage == null) {

          String msg = "Could not find packet for " + ackedSysMsgID
              + "in dest " + dest;
          logger.log(Logger.WARNING, msg);
          return;
        }
      } else {
        // this could happen e.g. if empty auto dest has been destroyed
        String msg = "Could not find destination for " + destID;
        logger.log(Logger.WARNING, msg);
        return;
      }

    } else {
      // no destid stored for some reason so need to load all dests
      logger.log(Logger.WARNING,
          "No dest ID for acked message. Will need to load all dests "
              + ackedSysMsgID);
      loadDestinations();

      ackedMessage = Destination.get(ackedSysMsgID);
      dest = ackedMessage.getDestination();
    }

    // need to unroute messages that have been consumed in a prepared
    // transaction.
    // they cannot be redelivered unless the transaction rolls back.

    dest.unrouteLoadedTransactionAckMessage(ackedMessage, consumerID);

  }
View Full Code Here

  return (cxnId);
    }

    public static Destination getDestination(ConsumerUID cid)  {
        Consumer con = Consumer.getConsumer(cid);
        Destination d = null;

  if (con != null)  {
            d = con.getFirstDestination();
  }
View Full Code Here

  ArrayList<String> al = new ArrayList<String>();
  Set dests = con.getDestinations();
    if (dests == null) return null;
  Iterator itr = dests.iterator();
  while (itr.hasNext()) {
      Destination dest = (Destination)itr.next();
      al.add(dest.getDestinationName());
  }

  if (al.size() > 0)  {
      ret = new String [ al.size() ];
      ret = (String[])al.toArray(ret);
View Full Code Here

  return(id.getName());
    }

    private static String getDestinationType(ConsumerUID cid)  {
  Destination d = ConsumerUtil.getDestination(cid);

  if (d == null)  {
      return (null);
  }

  return(d.isQueue() ? DestinationType.QUEUE : DestinationType.TOPIC);
    }
View Full Code Here

            com.sun.messaging.jmq.jmsserver.core.Subscription
                 obj = Subscription.subscribe(durableName,
                     clientID, selstr, duid,
                     noLocalDelivery, false, false);
            obj.setConsumerUID(id);
            Destination d = Destination.getDestination(duid);
            d.addConsumer(obj, true);
            Subscription.clearSubscriptions();           
            return obj;
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
View Full Code Here

    public void destroy(String type, String name) throws MBeanException  {
  try  {
      DestinationUtil.checkDestType(type);

      Destination d = Destination.removeDestination(name,
    (type.equals(DestinationType.QUEUE)),
    "JMX API");
     
      if (d == null)  {
                String subError = rb.getString(rb.E_NO_SUCH_DESTINATION,
View Full Code Here

  }

  ObjectName destONames[] = new ObjectName [ dests.size() ];

  for (int i =0; i < dests.size(); i ++) {
      Destination d = (Destination)dests.get(i);

      try  {
          ObjectName o = MQObjectName.createDestinationConfig(
        d.isQueue() ? DestinationType.QUEUE : DestinationType.TOPIC,
        d.getDestinationName());

          destONames[i] = o;
      } catch (Exception e)  {
    handleOperationException(DestinationOperations.GET_DESTINATIONS, e);
      }
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.jmsserver.core.Destination

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.