org.objectweb.dream.queue
Class AbstractPullOutgoingHandlerImpl
java.lang.Object
org.objectweb.dream.AbstractComponent
org.objectweb.dream.queue.AbstractPullOutgoingHandlerImpl
- All Implemented Interfaces:
- AttributeController, BindingController, LifeCycleController, Loggable, Pull, PullQueueAttributeController
- Direct Known Subclasses:
- PullOutgoingHandlerImpl
- public abstract class AbstractPullOutgoingHandlerImpl
- extends AbstractComponent
- implements Pull, PullQueueAttributeController
Abstract implementation of a Pull outgoing handler. It implements overflow
policies as defined in PullQueueAttributeController
. Moreover, it
implements the pull
method: it checks for available message
and then applies appropriate policy.
Pull incoming handler developers can inherit this class. They must implement
two methods:
hasAvailableMessage()
returns a boolean indicating
whether a message is available for removal.
doPull()
removes a message from the buffer.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
blockingPull
protected boolean blockingPull
bufferItf
protected Buffer bufferItf
bufferRemoveFirstLastItf
protected BufferRemoveFirstLast bufferRemoveFirstLastItf
AbstractPullOutgoingHandlerImpl
public AbstractPullOutgoingHandlerImpl()
pull
public Message pull(Map context)
throws PullException
- Specified by:
pull
in interface Pull
- Throws:
PullException
- See Also:
Pull.pull(java.util.Map)
hasAvailableMessage
protected abstract boolean hasAvailableMessage()
- Checks whether there is an available message.
- Returns:
true
if there is an available message.
doPull
protected abstract Message doPull()
throws InterruptedException
- Pulls a message from the buffer (i.e. get or remove). This method should
not check if there is a message available provided it has already been
done.
- Returns:
- a message.
- Throws:
InterruptedException
- if it is interrupted while waiting an
available message.
setBlockingPull
public void setBlockingPull(boolean blockingPull)
- Description copied from interface:
PullQueueAttributeController
- Sets the blocking pull policy.
- Specified by:
setBlockingPull
in interface PullQueueAttributeController
- Parameters:
blockingPull
- the blocking pull policy.- See Also:
PullQueueAttributeController.setBlockingPull(boolean)
getBlockingPull
public boolean getBlockingPull()
- Description copied from interface:
PullQueueAttributeController
- Returns the blocking pull policy.
- Specified by:
getBlockingPull
in interface PullQueueAttributeController
- Returns:
- the blocking pull policy.
- See Also:
PullQueueAttributeController.getBlockingPull()
bindFc
public void bindFc(String clientItfName,
Object serverItf)
throws NoSuchInterfaceException,
IllegalBindingException,
IllegalLifeCycleException
- Specified by:
bindFc
in interface BindingController
- Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
- See Also:
BindingController.bindFc(String,
Object)
listFc
public String[] listFc()
- Specified by:
listFc
in interface BindingController
- See Also:
BindingController.listFc()
Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.