Class InMemoryResenderModule
- java.lang.Object
-
- com.helger.as2lib.AbstractDynamicComponent
-
- com.helger.as2lib.processor.module.AbstractProcessorModule
-
- com.helger.as2lib.processor.module.AbstractActiveModule
-
- com.helger.as2lib.processor.resender.AbstractActiveResenderModule
-
- com.helger.as2lib.processor.resender.InMemoryResenderModule
-
- All Implemented Interfaces:
IDynamicComponent,IProcessorActiveModule,IProcessorModule,IProcessorResenderModule
public class InMemoryResenderModule extends AbstractActiveResenderModule
An asynchronous, in-memory, polling based resender module. Uponhandle(String, IMessage, Map)the document is added to a queue there is a background poller task that checks for resending (seeresend()). If resending fails an exception is thrown.- Since:
- 2.2.0
- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from class com.helger.as2lib.processor.resender.AbstractActiveResenderModule
ATTR_POLLING_INTERVAL_SECONDS, ATTR_RESEND_DELAY_SECONDS, DEFAULT_POLLING_MS, DEFAULT_RESEND_DELAY_MS
-
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Fields inherited from interface com.helger.as2lib.processor.resender.IProcessorResenderModule
DEFAULT_RETRIES, DO_RESEND, DO_RESENDMDN, OPTION_CAUSE, OPTION_INITIAL_SENDER, OPTION_RESEND_ACTION, OPTION_RETRIES
-
-
Constructor Summary
Constructors Constructor Description InMemoryResenderModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(String sAction, IMessage aMsg, Map<String,Object> aOptions)Check if this processor module can handle a certain action on the provided messagevoiddoStop()Implement the internal stop logic.com.helger.commons.collection.impl.ICommonsList<ResendItem>getAllResendItems()intgetResendItemCount()voidhandle(String sAction, IMessage aMsg, Map<String,Object> aOptions)Main handling of the message.voidremoveAllResendItems()Remove all resend items.voidresend()protected voidresendItem(ResendItem aItem)-
Methods inherited from class com.helger.as2lib.processor.resender.AbstractActiveResenderModule
doStart, equals, getResendDelayMS, hashCode, initDynamicComponent
-
Methods inherited from class com.helger.as2lib.processor.module.AbstractActiveModule
forceStop, isRunning, start, stop, toString
-
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSession
-
-
-
-
Method Detail
-
canHandle
public boolean canHandle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions)
Description copied from interface:IProcessorModuleCheck if this processor module can handle a certain action on the provided message- Specified by:
canHandlein interfaceIProcessorModule- Overrides:
canHandlein classAbstractActiveModule- Parameters:
sAction- The action to be executed. Nevernull.aMsg- The message in question. May be an AS2 message or an MDN message. Nevernull.aOptions- The options to be considered. May benull.- Returns:
trueof this module can handle the respective message,falseif not.
-
handle
public void handle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions) throws AS2Exception
Description copied from interface:IProcessorModuleMain handling of the message. Only called, ifIProcessorModule.canHandle(String, IMessage, Map)returnedtrue.- Specified by:
handlein interfaceIProcessorModule- Overrides:
handlein classAbstractActiveModule- Parameters:
sAction- The action to be executed. Nevernull.aMsg- The message in question. May be an AS2 message or an MDN message. Nevernull.aOptions- The options to be considered. May benull.- Throws:
AS2Exception- in case something goes wrong
-
resendItem
protected void resendItem(@Nonnull ResendItem aItem) throws AS2Exception
- Throws:
AS2Exception
-
resend
public void resend()
- Specified by:
resendin classAbstractActiveResenderModule
-
getResendItemCount
@Nonnegative public int getResendItemCount()
-
removeAllResendItems
public void removeAllResendItems()
Remove all resend items.
-
getAllResendItems
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<ResendItem> getAllResendItems()
-
doStop
public void doStop() throws AS2ExceptionDescription copied from class:AbstractActiveModuleImplement the internal stop logic.- Overrides:
doStopin classAbstractActiveResenderModule- Throws:
AS2Exception- In case of an error.
-
-