Package java.util.concurrent

Examples of java.util.concurrent.LinkedBlockingQueue$LBQSpliterator


   * @see java.util.concurrent.LinkedBlockingQueue
   * @see java.util.concurrent.SynchronousQueue
   */
  protected BlockingQueue createQueue(int queueCapacity) {
    if (queueCapacity > 0) {
      return new LinkedBlockingQueue(queueCapacity);
    }
    else {
      return new SynchronousQueue();
    }
  }
View Full Code Here


        if (!threadPoolEnabled)
            return new NonParallelExecutor();

        final ThreadPoolExecutor executorService = new ThreadPoolExecutor(coreSize, maxSize, keepAliveMillis,
                TimeUnit.MILLISECONDS, new LinkedBlockingQueue());

        shutdownHub.addRegistryShutdownListener(new RegistryShutdownListener()
        {
            public void registryDidShutdown()
            {
View Full Code Here

            throw new IllegalArgumentException("ListenerList cannot be null!");
        }

        m_eventAdmin = eventAdmin;
        m_listenerList = listenerList;
        m_eventQueue = new LinkedBlockingQueue();

        m_backgroundThread = new Thread(this, "UserAdmin event dispatcher");
    }
View Full Code Here

      try
      {
        //There's only one thread taking objects off the requestQueue, so this doesn't need to be synced
        byte[] requestBytes = (byte[]) requestChannel.take();

        LinkedBlockingQueue replyChannel = (LinkedBlockingQueue) requestChannel.take();

        if (keepRunningKeelDirectServer == false)
        {
          continue;
        }
View Full Code Here

       */
      byte[] requestBytes = message.serialize();

      requestChannel.put(requestBytes);

      LinkedBlockingQueue replyChannel = new LinkedBlockingQueue();

      requestChannel.put(replyChannel);
    }
    catch (InterruptedException e)
    {
View Full Code Here

  //   protected Channel getRequestChannel() {
  protected LinkedBlockingQueue getRequestChannel()
  {
    //     LinkedQueue toServer = new LinkedQueue();
    LinkedBlockingQueue toServer = new LinkedBlockingQueue();

    return toServer;
  }
View Full Code Here

  }
        return entry.getQueue();
    }
   
    public static FederatedQueryProcessor putWrappedEmptyQueueEntry(ReplicationState state, FederatedQueryProcessor aWrapper) {
        LinkedBlockingQueue aQueue = putEmptyQueueEntry(state);
        //FederatedRequestProcessor aWrapper = new FederatedRequestProcessor(1, 500);
        ReplicationResponseRepository repos = getInstance();
        repos.getFederatedQueryWrapperMap().put(state.getId(), aWrapper);
        return aWrapper;
    }
View Full Code Here

        ReplicationResponseRepositoryEntry entry
            = (ReplicationResponseRepositoryEntry) reposMap.get(key);
        if(entry == null) {
            return;
        }
        LinkedBlockingQueue aQueue = entry.getQueue();
        if(aQueue == null) {
            return;
        }
        aQueue.add(state);
    }
View Full Code Here

        ReplicationResponseRepositoryEntry entry
            = (ReplicationResponseRepositoryEntry) reposMap.get(id);
        if(entry == null) {
            return result;
        }
        LinkedBlockingQueue aQueue = entry.getQueue();
        //block and wait for result until timeout
        try {
            result = (ReplicationState)aQueue.poll(waitTime, TimeUnit.MILLISECONDS);
        } catch (InterruptedException ex) {
            // FIXME evaluate logging level
            if (_logger.isLoggable(Level.FINE)){
                _logger.log(Level.FINE, "ReplicationResponseRepository>>getEntry timed out", ex);
            }
        } finally {
            //clear entry from map
          if (entry.removeRequest()) {
                reposMap.remove(id);
                if(aQueue != null) {
                    aQueue.clear();
                    repos.getQueueForQueues().offer(aQueue);
                }
          }
        }
        return result;
View Full Code Here

            return getEntry(id, waitTime);
        }
    }    
   
    private LinkedBlockingQueue getQueue() {
        LinkedBlockingQueue result = null;      
        result = (LinkedBlockingQueue)_queueForQueues.poll();
        if (result == null) {
            //if none in _queueForQueues, create new queue
            result = getNewQueue();
        }
View Full Code Here

TOP

Related Classes of java.util.concurrent.LinkedBlockingQueue$LBQSpliterator

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.