Package com.helger.as2lib.processor
Class AbstractMessageProcessor
- java.lang.Object
-
- com.helger.as2lib.AbstractDynamicComponent
-
- com.helger.as2lib.processor.AbstractMessageProcessor
-
- All Implemented Interfaces:
IDynamicComponent
,IMessageProcessor
- Direct Known Subclasses:
AsyncMessageProcessor
,DefaultMessageProcessor
public abstract class AbstractMessageProcessor extends AbstractDynamicComponent implements IMessageProcessor
Abstract empty implementation ofIMessageProcessor
. It provides all methods exceptIMessageProcessor.handle(String, com.helger.as2lib.message.IMessage, java.util.Map)
.- Author:
- Philip Helger
-
-
Field Summary
-
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
Fields inherited from interface com.helger.as2lib.processor.IMessageProcessor
ATTR_PENDINGMDN, ATTR_PENDINGMDNINFO
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractMessageProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModule(IProcessorModule aModule)
boolean
equals(Object o)
protected void
executeAction(String sAction, IMessage aMsg, Map<String,Object> aOptions)
Execution the provided action with the registered modules.com.helger.commons.collection.impl.ICommonsList<IProcessorActiveModule>
getAllActiveModules()
com.helger.commons.collection.impl.ICommonsList<IProcessorModule>
getAllModules()
<T extends IProcessorModule>
com.helger.commons.collection.impl.ICommonsList<T>getAllModulesOfClass(Class<T> aClass)
int
getModuleCount()
<T extends IProcessorModule>
TgetModuleOfClass(Class<T> aClass)
int
hashCode()
com.helger.commons.state.EChange
removeModule(IProcessorModule aModule)
void
startActiveModules()
Callstart
on all modules that implement theIProcessorActiveModule
interface.void
stopActiveModules()
Callstop
on all modules that implement theIProcessorActiveModule
interface.-
Methods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSession, initDynamicComponent, toString
-
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
-
Methods inherited from interface com.helger.as2lib.processor.IMessageProcessor
getPendingMDNFolder, getPendingMDNInfoFolder, handle, setPendingMDNFolder, setPendingMDNInfoFolder
-
-
-
-
Method Detail
-
addModule
public void addModule(@Nonnull IProcessorModule aModule)
- Specified by:
addModule
in interfaceIMessageProcessor
-
removeModule
@Nonnull public com.helger.commons.state.EChange removeModule(@Nullable IProcessorModule aModule)
- Specified by:
removeModule
in interfaceIMessageProcessor
-
getModuleCount
@Nonnegative public int getModuleCount()
- Specified by:
getModuleCount
in interfaceIMessageProcessor
-
getAllModules
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IProcessorModule> getAllModules()
- Specified by:
getAllModules
in interfaceIMessageProcessor
-
getModuleOfClass
@Nullable public <T extends IProcessorModule> T getModuleOfClass(@Nonnull Class<T> aClass)
- Specified by:
getModuleOfClass
in interfaceIMessageProcessor
-
getAllModulesOfClass
@Nonnull @ReturnsMutableCopy public <T extends IProcessorModule> com.helger.commons.collection.impl.ICommonsList<T> getAllModulesOfClass(@Nonnull Class<T> aClass)
- Specified by:
getAllModulesOfClass
in interfaceIMessageProcessor
-
getAllActiveModules
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IProcessorActiveModule> getAllActiveModules()
- Specified by:
getAllActiveModules
in interfaceIMessageProcessor
- Returns:
- A list of all modules, that implement the
IProcessorActiveModule
interface. Nevernull
but maybe empty.
-
startActiveModules
public void startActiveModules()
Description copied from interface:IMessageProcessor
Callstart
on all modules that implement theIProcessorActiveModule
interface.- Specified by:
startActiveModules
in interfaceIMessageProcessor
-
stopActiveModules
public void stopActiveModules()
Description copied from interface:IMessageProcessor
Callstop
on all modules that implement theIProcessorActiveModule
interface.- Specified by:
stopActiveModules
in interfaceIMessageProcessor
-
executeAction
protected final void executeAction(@Nonnull String sAction, @Nonnull IMessage aMsg, @Nullable Map<String,Object> aOptions) throws AS2Exception
Execution the provided action with the registered modules.- Parameters:
sAction
- Action to execute. Nevernull
.aMsg
- Message it is about. Nevernull
.aOptions
- Optional options map to be used. May benull
.- Throws:
AS2Exception
- In case of error
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractDynamicComponent
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classAbstractDynamicComponent
-
-