org.objectweb.dream.pump
Class AbstractPumpSynchronizedImpl

java.lang.Object
  extended by org.objectweb.dream.AbstractComponent
      extended by org.objectweb.dream.pump.AbstractPumpSynchronizedImpl
All Implemented Interfaces:
ContextualBindingController, NeedAsyncStartController, PrepareStopLifeCycleController, Loggable, PumpAttributeController, AttributeController, BindingController, LifeCycleController
Direct Known Subclasses:
PumpPeriodicSynchronizedImpl, PumpSynchronizedImpl

public abstract class AbstractPumpSynchronizedImpl
extends AbstractComponent
implements PumpAttributeController

Abstract implementation of a synchronized Pull/Push pump. This component has an optional Mutex client interface that it uses to synchronize the execution of its run method with other components.


Field Summary
protected  Pull inPullItf
           
protected  MessageManager messageManagerItf
           
protected  Mutex mutexItf
           
protected  Push outPushItf
           
protected  AbstractTask pumpTask
           
protected  boolean pushNullPolicy
           
protected  boolean stopOnPullExceptionPolicy
           
protected  boolean stopOnPushExceptionPolicy
           
 
Fields inherited from class org.objectweb.dream.AbstractComponent
bindingLogger, fcNeedAsyncStart, fcState, lifeCycleLogger, logger, weaveableC
 
Fields inherited from interface org.objectweb.fractal.api.control.LifeCycleController
STARTED, STOPPED
 
Constructor Summary
AbstractPumpSynchronizedImpl()
           
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
           
 boolean getPushNullPolicy()
          Returns the PushNullPolicy.
 boolean getStopOnPullExceptionPolicy()
          Returns the StopOnPullExceptionPolicy.
 boolean getStopOnPushExceptionPolicy()
          Returns the StopOnPushExceptionPolicy.
protected  Object handlePullException(PullException exception)
          Handles a PullException occurring when the activity tries to pull a message.
protected  Object handlePushException(Message message, PushException exception)
          Handles a PushException occurring when the activity tries to push a message.
 String[] listFc()
           
 void setPushNullPolicy(boolean pushNull)
          Sets the PushNullPolicy.
 void setStopOnPullExceptionPolicy(boolean stopOnPullException)
          Sets the StopOnPullExceptionPolicy.
 void setStopOnPushExceptionPolicy(boolean stopOnPushException)
          Sets the StopOnPushExceptionPolicy.
 
Methods inherited from class org.objectweb.dream.AbstractComponent
beforeFirstStart, 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

outPushItf

protected Push outPushItf

inPullItf

protected Pull inPullItf

mutexItf

protected Mutex mutexItf

messageManagerItf

protected MessageManager messageManagerItf

pushNullPolicy

protected boolean pushNullPolicy

stopOnPushExceptionPolicy

protected boolean stopOnPushExceptionPolicy

stopOnPullExceptionPolicy

protected boolean stopOnPullExceptionPolicy

pumpTask

protected AbstractTask pumpTask
Constructor Detail

AbstractPumpSynchronizedImpl

public AbstractPumpSynchronizedImpl()
Method Detail

getPushNullPolicy

public boolean getPushNullPolicy()
Description copied from interface: PumpAttributeController
Returns the PushNullPolicy.

Specified by:
getPushNullPolicy in interface PumpAttributeController
Returns:
the PushNullPolicy.
See Also:
PumpAttributeController.getPushNullPolicy()

setPushNullPolicy

public void setPushNullPolicy(boolean pushNull)
Description copied from interface: PumpAttributeController
Sets the PushNullPolicy.

Specified by:
setPushNullPolicy in interface PumpAttributeController
Parameters:
pushNull - the PushNullPolicy.
See Also:
PumpAttributeController.setPushNullPolicy(boolean)

getStopOnPushExceptionPolicy

public boolean getStopOnPushExceptionPolicy()
Description copied from interface: PumpAttributeController
Returns the StopOnPushExceptionPolicy.

Specified by:
getStopOnPushExceptionPolicy in interface PumpAttributeController
Returns:
the StopOnPushExceptionPolicy.
See Also:
PumpAttributeController.getStopOnPushExceptionPolicy()

setStopOnPushExceptionPolicy

public void setStopOnPushExceptionPolicy(boolean stopOnPushException)
Description copied from interface: PumpAttributeController
Sets the StopOnPushExceptionPolicy.

Specified by:
setStopOnPushExceptionPolicy in interface PumpAttributeController
Parameters:
stopOnPushException - the StopOnPushExceptionPolicy.
See Also:
PumpAttributeController.setStopOnPushExceptionPolicy(boolean)

getStopOnPullExceptionPolicy

public boolean getStopOnPullExceptionPolicy()
Description copied from interface: PumpAttributeController
Returns the StopOnPullExceptionPolicy.

Specified by:
getStopOnPullExceptionPolicy in interface PumpAttributeController
Returns:
the StopOnPullExceptionPolicy.
See Also:
PumpAttributeController.getStopOnPullExceptionPolicy()

setStopOnPullExceptionPolicy

public void setStopOnPullExceptionPolicy(boolean stopOnPullException)
Description copied from interface: PumpAttributeController
Sets the StopOnPullExceptionPolicy.

Specified by:
setStopOnPullExceptionPolicy in interface PumpAttributeController
Parameters:
stopOnPullException - the StopOnPullExceptionPolicy.
See Also:
PumpAttributeController.setStopOnPullExceptionPolicy(boolean)

handlePushException

protected Object handlePushException(Message message,
                                     PushException exception)
Handles a PushException occurring when the activity tries to push a message. This implementation simply deletes the message using message manger.

Parameters:
message - the pushed message
exception - the exception thrown during the push call.

handlePullException

protected Object handlePullException(PullException exception)
Handles a PullException occurring when the activity tries to pull a message.

Parameters:
exception - the exception thrown during the pull call.

listFc

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

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
            throws NoSuchInterfaceException,
                   IllegalBindingException,
                   IllegalLifeCycleException
Specified by:
bindFc in interface BindingController
Overrides:
bindFc in class AbstractComponent
Throws:
NoSuchInterfaceException
IllegalBindingException
IllegalLifeCycleException
See Also:
BindingController.bindFc(String, Object)


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