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 forIProcessorActiveModule
derived 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 boolean
canHandle(String sAction, IMessage aMsg, Map<String,Object> aOptions)
Check if this processor module can handle a certain action on the provided messageabstract void
doStart()
Implement the internal start logic.abstract void
doStop()
Implement the internal stop logic.boolean
equals(Object o)
void
forceStop(Exception aCause)
void
handle(String sAction, IMessage aMsg, Map<String,Object> aOptions)
Main handling of the message.int
hashCode()
boolean
isRunning()
void
start()
Start the modulevoid
stop()
Stop the moduleString
toString()
-
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:
isRunning
in interfaceIProcessorActiveModule
- Returns:
true
of the module is running,false
if not.
-
canHandle
@OverrideOnDemand public boolean canHandle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions)
Description copied from interface:IProcessorModule
Check if this processor module can handle a certain action on the provided message- Specified by:
canHandle
in 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:
true
of this module can handle the respective message,false
if not.
-
handle
public void handle(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions) throws AS2Exception
Description copied from interface:IProcessorModule
Main handling of the message. Only called, ifIProcessorModule.canHandle(String, IMessage, Map)
returnedtrue
.- Specified by:
handle
in 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 AS2Exception
Implement the internal start logic.- Throws:
AS2Exception
- In case of an error.
-
start
public void start() throws AS2Exception
Description copied from interface:IProcessorActiveModule
Start the module- Specified by:
start
in interfaceIProcessorActiveModule
- Throws:
AS2Exception
- in case starting failed
-
doStop
public abstract void doStop() throws AS2Exception
Implement the internal stop logic.- Throws:
AS2Exception
- In case of an error.
-
stop
public void stop() throws AS2Exception
Description copied from interface:IProcessorActiveModule
Stop the module- Specified by:
stop
in interfaceIProcessorActiveModule
- Throws:
AS2Exception
- in case stopping failed
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractDynamicComponent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDynamicComponent
-
toString
public String toString()
- Overrides:
toString
in classAbstractDynamicComponent
-
-