org.objectweb.dream.queue
Class NotSynchronizedPushPullQueueImpl

java.lang.Object
  extended byorg.objectweb.dream.AbstractComponent
      extended byorg.objectweb.dream.queue.NotSynchronizedPushPullQueueImpl
All Implemented Interfaces:
AttributeController, BindingController, LifeCycleController, Loggable, Pull, Push, PushQueueAttributeController, QueueAttributeController

public class NotSynchronizedPushPullQueueImpl
extends AbstractComponent
implements Push, Pull, PushQueueAttributeController

High performance implementation of a Push/Pull queue. This queue is not thread safe and its pull interface is non blocking (return null if the buffer is empty).


Field Summary
protected  LinkedList waitingList
          The LinkedList containing waiting message
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, componentDesc, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.Push
IN_PUSH_ITF_NAME, OUT_PUSH_ITF_NAME
 
Fields inherited from interface org.objectweb.dream.Pull
IN_PULL_ITF_NAME, OUT_PULL_ITF_NAME
 
Fields inherited from interface org.objectweb.dream.queue.PushQueueAttributeController
BLOCK_OVERFLOW_POLICY, DROP_OVERFLOW_POLICY, EXCEPTION_OVERFLOW_POLICY
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
NotSynchronizedPushPullQueueImpl()
           
 
Method Summary
 int getCurrentSize()
          Returns the current size of the queue.
 int getMaxCapacity()
          Returns the maximum capacity of the queue.
 String getOverflowPolicy()
          Returns the overflow policy.
 String[] listFc()
           
 Message pull(Map context)
           
 void push(Message message, Map context)
           
 void setMaxCapacity(int maxCapacity)
          Sets the maximum capacity of the queue.
 void setOverflowPolicy(String policy)
          Sets the overflow policy.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
bindFc, getFcState, initComponent, lookupFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

waitingList

protected LinkedList waitingList
The LinkedList containing waiting message

Constructor Detail

NotSynchronizedPushPullQueueImpl

public NotSynchronizedPushPullQueueImpl()
Method Detail

push

public void push(Message message,
                 Map context)
Specified by:
push in interface Push
See Also:
Push.push(org.objectweb.dream.message.Message, java.util.Map)

pull

public Message pull(Map context)
Specified by:
pull in interface Pull
See Also:
Pull.pull(java.util.Map)

getOverflowPolicy

public String getOverflowPolicy()
Description copied from interface: PushQueueAttributeController
Returns the overflow policy.

Specified by:
getOverflowPolicy in interface PushQueueAttributeController
Returns:
the overflow policy.
See Also:
PushQueueAttributeController.getOverflowPolicy()

setOverflowPolicy

public void setOverflowPolicy(String policy)
Description copied from interface: PushQueueAttributeController
Sets the overflow policy.

Specified by:
setOverflowPolicy in interface PushQueueAttributeController
Parameters:
policy - the overflow policy.
See Also:
PushQueueAttributeController.setOverflowPolicy(java.lang.String)

getCurrentSize

public int getCurrentSize()
Description copied from interface: QueueAttributeController
Returns the current size of the queue.

Specified by:
getCurrentSize in interface QueueAttributeController
Returns:
the current size of the queue.
See Also:
QueueAttributeController.getCurrentSize()

getMaxCapacity

public int getMaxCapacity()
Description copied from interface: QueueAttributeController
Returns the maximum capacity of the queue.

Specified by:
getMaxCapacity in interface QueueAttributeController
Returns:
the maximum capacity of the queue.
See Also:
QueueAttributeController.getMaxCapacity()

setMaxCapacity

public void setMaxCapacity(int maxCapacity)
Description copied from interface: QueueAttributeController
Sets the maximum capacity of the queue.

Specified by:
setMaxCapacity in interface QueueAttributeController
Parameters:
maxCapacity - the maximum capacity of the queue.
See Also:
QueueAttributeController.setMaxCapacity(int)

listFc

public String[] listFc()
Specified by:
listFc in interface BindingController
See Also:
BindingController.listFc()


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.