org.instrumentmiddleware.cima.transport.delivery.impl
Class TooBadDeliveryStrategy

java.lang.Object
  extended by org.instrumentmiddleware.cima.transport.delivery.impl.AbstractDeliveryStrategy
      extended by org.instrumentmiddleware.cima.transport.delivery.impl.TooBadDeliveryStrategy
All Implemented Interfaces:
java.util.concurrent.Callable<org.instrumentmiddleware.cima.parcel.ParcelDocument.Parcel>, IDeliveryStrategy

public class TooBadDeliveryStrategy
extends AbstractDeliveryStrategy

TooBadDeliveryStrategy (aka. OneTryDeliveryStrategy) is always available for delivery. If the underlying ITransportProvider is unable to perform delivery, then that's too bad and the parcel is lost. If the transmission fails for some reason, then that's too bad and the parcel is lost.

Author:
andrew

Field Summary
 
Fields inherited from class org.instrumentmiddleware.cima.transport.delivery.impl.AbstractDeliveryStrategy
executor, log, parcel, transportManager
 
Constructor Summary
TooBadDeliveryStrategy(ITransportManager transportManager, java.util.concurrent.ExecutorService executor)
          Initialise this delivery strategy.
 
Method Summary
 org.instrumentmiddleware.cima.parcel.ParcelDocument.Parcel deliver()
          Commence delivery.
 
Methods inherited from class org.instrumentmiddleware.cima.transport.delivery.impl.AbstractDeliveryStrategy
call, canRun, setRegisteredParcel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TooBadDeliveryStrategy

public TooBadDeliveryStrategy(ITransportManager transportManager,
                              java.util.concurrent.ExecutorService executor)
                       throws java.lang.Exception
Initialise this delivery strategy. A valid transport manager is required to correctly construct this object.

Parameters:
transportManager -
Throws:
java.lang.Exception - if the required transport manager is not valid
See Also:
AbstractDeliveryStrategy(ITransportManager)
Method Detail

deliver

public org.instrumentmiddleware.cima.parcel.ParcelDocument.Parcel deliver()
Commence delivery. This method should not be called directly, but should be called as a result of starting a new thread. Initially, a check is made to see if there is enough information to attempt delivery, if not this method returns immediately. For each recipient, an attempt is made to deliver the parcel only if an appropriate endpoint and transport provider are available. If delivery to a recipient fails no further attempt is made to deliver the parcel to that recipient.



Copyright © 2008. All Rights Reserved.