Examples of Queue


Examples of org.objectweb.joram.client.jms.Queue

          if (className == null)
            className = "org.objectweb.joram.mom.dest.Queue";
          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG,
                       "Queue.create(" + serverId + "," + name + "," + className + "," + properties + ")");
          Queue queue = (Queue) getWrapper().createQueue(serverId, name, className, properties);
          properties = null;

          configureDestination(queue);

          if (threshold > 0)
            queue.setThreshold(threshold);

          if (nbMaxMsg > 0)
            queue.setNbMaxMsg(nbMaxMsg);

          // Bind the queue in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, queue);
          jndiName = null;
          // Register the queue in order to handle it later (cluster, etc.)
          String name = queue.getAdminName();
          if (! isSet(name)) name = queue.getName();
          queues.put(name, queue);
          // Fix DMQ if any
          setDestinationDMQ(queue, dmq);
        } else if (rawName.equals(ELT_TOPIC)) {
          if (className == null)
            className = "org.objectweb.joram.mom.dest.Topic";
          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG,
                       "Topic.create(" + serverId + "," + name + "," + className + "," + properties + ")");
          Topic topic = (Topic) getWrapper().createTopic(serverId, name, className, properties);
          properties = null;

          configureDestination(topic);

          if (isSet(parent)) {
            // TODO (AF): may be we should search the parent topic: JNDI? Joram?
            if (topics.containsKey(parent)) {
              topic.setParent((Topic) topics.get(parent));
            } else {
              logger.log(BasicLevel.ERROR,
                   "Topic.create(): Unknown parent: " + parent);
            }
          }
          // Bind the topic in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, topic);
          jndiName = null;
          // Register the topic in order to handle it later (cluster, etc.)
          String name = topic.getAdminName();
          if (! isSet(name)) name = topic.getName();
          topics.put(name, topic);
          // Fix DMQ if any
          setDestinationDMQ(topic, dmq);
        } else if (rawName.equals(ELT_DMQUEUE)) {
          className = "org.objectweb.joram.mom.dest.Queue";
          if (logger.isLoggable(BasicLevel.DEBUG))
            logger.log(BasicLevel.DEBUG,
                       "DeadMQueue.create(" + serverId + "," + name + ")");

          DeadMQueue dmq = (DeadMQueue) getWrapper().createDeadMQueue(serverId, name);

          configureDestination(dmq);

          // Bind the destination in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, dmq);
          jndiName = null;
          // Register the DMQ in order to handle it later.
          if (isSet(name))
            dmqs.put(name, dmq);
        } else if (rawName.equals(ELT_PROPERTY)) {
        } else if (rawName.equals(ELT_READER)) {
          readers.add(user);
        } else if (rawName.equals(ELT_WRITER)) {
          writers.add(user);
        } else if (rawName.equals(ELT_FREEREADER)) {
        } else if (rawName.equals(ELT_FREEWRITER)) {
        } else if (rawName.equals(ELT_INITIALCONTEXT)) {
          try {
            jndiCtx = new javax.naming.InitialContext(properties);
          } catch (NamingException exc) {
            logger.log(BasicLevel.ERROR,"",exc);
          }
        } else if (rawName.equals(ELT_CLUSTER_ELEMENT)) {
        } else if (rawName.equals(ELT_CLUSTER_CF)) {
          Map.Entry entries[] = new Map.Entry [cluster.size()];
          cluster.entrySet().toArray(entries);
          ClusterConnectionFactory clusterCF = new ClusterConnectionFactory();

          for (int i=0; i<entries.length; i++) {
            ConnectionFactory cf = (ConnectionFactory) cfs.get(entries[i].getKey());
            clusterCF.addConnectionFactory((String) entries[i].getValue(), cf);
          }
          cluster.clear();

          // Bind the destination in JNDI.
          // Be Careful, currently only one binding is handled.
          if (isSet(jndiName))
            toBind.put(jndiName, clusterCF);
          jndiName = null;
        } else if (rawName.equals(ELT_CLUSTER_QUEUE)) {
          Map.Entry entries[] = new Map.Entry [cluster.size()];
          cluster.entrySet().toArray(entries);
          ClusterQueue clusterQueue = new ClusterQueue();
          clusterQueue.setWrapper(getWrapper());

          Queue root = null;
          for (int i=0; i<entries.length; i++) {
            Queue queue = (Queue) queues.get(entries[i].getKey());
            clusterQueue.addDestination((String) entries[i].getValue(), queue);
            if (i == 0)
              root = queue;
            else
              root.addClusteredQueue(queue);
View Full Code Here

Examples of org.objectweb.joram.client.jms.Queue

   * @exception ConnectException  If the administration connection is closed or broken.
   * @exception AdminException  If the request fails.
   */
  public Queue getDMQ() throws ConnectException, AdminException {
    String dmqId = getDMQId();
    Queue dmq = null;
    if (dmqId != null) {
      dmq = new Queue(dmqId);
      if (wrapper != null)
        dmq.setWrapper(wrapper);
    }
    return dmq;
  }
View Full Code Here

Examples of org.objectweb.joram.mom.dest.Queue

    DestinationDesc desc = AdminTopic.lookupDest(req.getName(), req.getType());
    if (desc == null) {
      Destination dest = null;
      if (DestinationConstants.isQueue(req.getType())) {
        // Create a local queue.
        dest = new Queue();
      } else if (DestinationConstants.isTopic(req.getType())) {
        // Create a local topic.
        dest = new Topic();
      } else {
        throw new RequestException("Could not create destination, unknown type:" + req.getType());
View Full Code Here

Examples of org.simoes.lpd.util.Queue

   
    /** constructor.
     * @param name - name of the print queue.
     */
    public PrintQueue(String name) {
    queue = new Queue(name);
    lock = new Lock(name);
    }
View Full Code Here

Examples of org.springframework.amqp.core.Queue

    connectionFactory.setPassword(svc_passwd);
    connectionFactory.setVirtualHost(svc_vhost);

    String queueName = "CLOUD";
    AmqpAdmin amqpAdmin = new RabbitAdmin(connectionFactory);
    Queue cloudQueue = new Queue(queueName);
    amqpAdmin.declareQueue(cloudQueue);

    RabbitTemplate template = new RabbitTemplate(connectionFactory);
    template.setRoutingKey(queueName);
    template.setQueue(queueName);
View Full Code Here

Examples of org.wijiscommons.ssaf.queue.Queue

  public void startProcessing()
  {
    QueueMessage msg = messageQueue.readHeadMessage();
        if (msg != null) {
          try {
              Queue stashq = QueueService.getQueue(provider.getStashQueueName(folderName));
            stashq.enqueue(msg);
            for (int i = 0; i < workflowNames.size(); i++) {
                String workflowName = workflowNames.get(i);
                Queue workflowq = QueueService.getQueue(provider.getWorkflowQueueName(folderName, workflowName));
                workflowq.enqueue(msg);
              }
                messageQueue.removeHeadMessage(msg);
          }
          catch (QueueException qe)
          {
View Full Code Here

Examples of org.wso2.carbon.messagebox.queue.Queue

        try {
            UserRegistry userRegistry = Utils.getUserRegistry();
            Collection queuesResource =
                    (Collection) userRegistry.get(MessageBoxConstants.MB_QUEUE_STORAGE_PATH);
            Resource queueResource;
            Queue queue;
            String createdTime;
            String updatedTime;
            String createdFrom;
            for (String childResource : queuesResource.getChildren()) {
                queueName = childResource.substring(childResource.indexOf(MessageBoxConstants.MB_QUEUE_STORAGE_PATH)
                                                    + MessageBoxConstants.MB_QUEUE_STORAGE_PATH.length() + 1);
                queueResource = userRegistry.get(childResource);
                queue = new Queue(queueName);
                createdTime = queueResource.getProperty(MessageBoxConstants.MB_QUEUE_PROPERTY_CREATED_TIME);
                if (createdTime != null) {
                    queue.setCreatedTime(ConverterUtil.convertToDateTime(createdTime));
                }
                updatedTime = queueResource.getProperty(MessageBoxConstants.MB_QUEUE_PROPERTY_UPDATED_TIME);
                if (updatedTime != null) {
                    queue.setUpdatedTime(ConverterUtil.convertToDateTime(updatedTime));
                }
                createdFrom = queueResource.getProperty(MessageBoxConstants.MB_QUEUE_PROPERTY_CREATED_FROM);
                if (createdFrom != null) {
                    queue.setCreatedFrom(createdFrom);
                }
                Object queueDepth = getAttribute(queueName, MessageBoxConstants.MB_QUEUE_ATTR_QUEUE_DEPTH);
                if (queueDepth != null) {
                    queue.setQueueDepth((Long) queueDepth);
                } else {
                    queue.setQueueDepth(0);
                }

                Object messageCount = getAttribute(queueName, MessageBoxConstants.MB_QUEUE_ATTR_MESSAGE_COUNT);
                if (messageCount != null) {
                    queue.setMessageCount((Integer) messageCount);
                } else {
                    queue.setMessageCount(0);
                }

                queues.add(queue);
            }
            return queues;
View Full Code Here

Examples of streamer.Queue

        // Transition
        //

        add(
                // To transfer packets between input threads and output thread.
                new Queue("queue"),

                // Slow path: MultiChannel Support
                new ServerMCSPDU("server_mcs")

                );
View Full Code Here

Examples of sun.misc.Queue

     */
    public void sendEvent(int id) {
        synchronized(this) {
            if (queue == null) {
                //System.out.println("SEND0= " + id);
                queue = new Queue();
            }
            Integer eventId = new Integer(id);
            queue.enqueue(eventId);
            notifyAll();
        }
View Full Code Here

Examples of weka.core.Queue

      }
      m_OutputFormat.setRelationName(relationName);
    } else {
      m_OutputFormat = null;
    }
    m_OutputQueue = new Queue();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.