com.hazelcast.spi.impl.operationexecutor.classic
Class DefaultScheduleQueue

java.lang.Object
  extended by com.hazelcast.spi.impl.operationexecutor.classic.DefaultScheduleQueue
All Implemented Interfaces:
ScheduleQueue

public final class DefaultScheduleQueue
extends Object
implements ScheduleQueue


Constructor Summary
DefaultScheduleQueue()
           
DefaultScheduleQueue(BlockingQueue normalQueue, ConcurrentLinkedQueue priorityQueue)
           
 
Method Summary
 void add(Object task)
          Adds an task with normal priority to this queue.
 void addUrgent(Object task)
          Adds an task with normal priority to this queue.
 int normalSize()
          returns the number of normal operations pending.
 int prioritySize()
          returns the number of priority operations pending.
 int size()
          Returns the total number of pending operations.
 Object take()
          Takes an item from this queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultScheduleQueue

public DefaultScheduleQueue()

DefaultScheduleQueue

public DefaultScheduleQueue(BlockingQueue normalQueue,
                            ConcurrentLinkedQueue priorityQueue)
Method Detail

add

public void add(Object task)
Description copied from interface: ScheduleQueue
Adds an task with normal priority to this queue.

This method is thread safe.

Specified by:
add in interface ScheduleQueue
Parameters:
task - the item to add

addUrgent

public void addUrgent(Object task)
Description copied from interface: ScheduleQueue
Adds an task with normal priority to this queue.

This method is thread safe.

Specified by:
addUrgent in interface ScheduleQueue
Parameters:
task - the item to add

normalSize

public int normalSize()
Description copied from interface: ScheduleQueue
returns the number of normal operations pending.

This method is thread safe. This method returns a best effort value and should only be used for monitoring purposes.

Specified by:
normalSize in interface ScheduleQueue
Returns:
the number of normal pending operations.

prioritySize

public int prioritySize()
Description copied from interface: ScheduleQueue
returns the number of priority operations pending.

This method is thread safe. This method returns a best effort value and should only be used for monitoring purposes.

Specified by:
prioritySize in interface ScheduleQueue
Returns:
the number of priority pending operations.

size

public int size()
Description copied from interface: ScheduleQueue
Returns the total number of pending operations.

This method is thread safe. This method returns a best effort value and should only be used for monitoring purposes.

Specified by:
size in interface ScheduleQueue
Returns:
the total number of pending operations.

take

public Object take()
            throws InterruptedException
Description copied from interface: ScheduleQueue
Takes an item from this queue. If no item is available, the call blocks.

This method should always be called by the same thread.

Specified by:
take in interface ScheduleQueue
Returns:
the taken item.
Throws:
InterruptedException - if the thread is interrupted while waiting.


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.