org.objectweb.dream.queue
Class PushPullQueueFastImpl

java.lang.Object
  extended by org.objectweb.dream.AbstractComponent
      extended by org.objectweb.dream.queue.PushPullQueueFastImpl
All Implemented Interfaces:
ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, Pull, Push, BufferAttributeController, AttributeController, BindingController, LifeCycleController

public class PushPullQueueFastImpl
extends AbstractComponent
implements Push, Pull, BufferAttributeController

High performance implementation of a Push/Pull queue. This queue has the following properties :


Field Summary
protected  List<Message> list
           
protected  int size
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.dream.Push
IN_PUSH_ITF_NAME, INCOMING_IN_PUSH_ITF_NAME, INCOMING_OUT_PUSH_ITF_NAME, OUT_PUSH_ITF_NAME, OUTGOING_IN_PUSH_ITF_NAME, OUTGOING_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.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
PushPullQueueFastImpl()
           
 
Method Summary
 int getCurrentSize()
          Returns the current size of the queue.
 int getMaxCapacity()
          Returns the maximum capacity of the queue.
 String[] listFc()
           
 Message pull()
           
 void push(Message message)
           
 void setMaxCapacity(int maxCapacity)
          Sets the maximum capacity of the queue.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, bindFc, bindFc, getFcNeedAsyncStart, getFcState, initComponent, lookupFc, prepareStopFc, setLogger, startFc, stopFc, unbindFc
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected List<Message> list

size

protected int size
Constructor Detail

PushPullQueueFastImpl

public PushPullQueueFastImpl()
Method Detail

push

public void push(Message message)
Specified by:
push in interface Push
See Also:
Push.push(Message)

pull

public Message pull()
             throws PullException
Specified by:
pull in interface Pull
Throws:
PullException
See Also:
Pull.pull()

getCurrentSize

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

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

getMaxCapacity

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

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

setMaxCapacity

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

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

listFc

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


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