Class AbstractActiveModule
- java.lang.Object
-
- com.helger.as2lib.AbstractDynamicComponent
-
- com.helger.as2lib.processor.module.AbstractProcessorModule
-
- com.helger.as2lib.processor.module.AbstractActiveModule
-
- All Implemented Interfaces:
IDynamicComponent,IProcessorActiveModule,IProcessorModule
- Direct Known Subclasses:
AbstractActiveReceiverModule,AbstractActiveResenderModule
public abstract class AbstractActiveModule extends AbstractProcessorModule implements IProcessorActiveModule
Abstract base implementation forIProcessorActiveModulederived fromAbstractProcessorModule.- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
-
Constructor Summary
Constructors Constructor Description AbstractActiveModule()
-
Method Summary
All Methods Instance Methods Abstract 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 messageabstract voiddoStart()Implement the internal start logic.abstract voiddoStop()Implement the internal stop logic.booleanequals(Object o)voidforceStop(Exception aCause)voidhandle(String sAction, IMessage aMsg, Map<String,Object> aOptions)Main handling of the message.inthashCode()booleanisRunning()voidstart()Start the modulevoidstop()Stop the moduleStringtoString()-
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, initDynamicComponent
-
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, initDynamicComponent
-
-
-
-
Method Detail
-
isRunning
public final boolean isRunning()
- Specified by:
isRunningin interfaceIProcessorActiveModule- Returns:
trueof the module is running,falseif not.
-
canHandle
@OverrideOnDemand 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- 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- 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
-
doStart
public abstract void doStart() throws AS2ExceptionImplement the internal start logic.- Throws:
AS2Exception- In case of an error.
-
start
public void start() throws AS2ExceptionDescription copied from interface:IProcessorActiveModuleStart the module- Specified by:
startin interfaceIProcessorActiveModule- Throws:
AS2Exception- in case starting failed
-
doStop
public abstract void doStop() throws AS2ExceptionImplement the internal stop logic.- Throws:
AS2Exception- In case of an error.
-
stop
public void stop() throws AS2ExceptionDescription copied from interface:IProcessorActiveModuleStop the module- Specified by:
stopin interfaceIProcessorActiveModule- Throws:
AS2Exception- in case stopping failed
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classAbstractDynamicComponent
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDynamicComponent
-
toString
public String toString()
- Overrides:
toStringin classAbstractDynamicComponent
-
-