Class AbstractActivePollingModule
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
com.helger.as2lib.processor.module.AbstractProcessorModule
com.helger.as2lib.processor.module.AbstractActiveModule
com.helger.as2lib.processor.receiver.AbstractActiveReceiverModule
com.helger.as2lib.processor.receiver.AbstractActivePollingModule
- All Implemented Interfaces:
IDynamicComponent,IProcessorActiveModule,IProcessorModule,IProcessorReceiverModule
- Direct Known Subclasses:
AbstractDirectoryPollingModule
-
Field Summary
FieldsFields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoStart()Implement the internal start logic.voiddoStop()Implement the internal stop logic.longvoidinitDynamicComponent(IAS2Session aSession, com.helger.commons.collection.attr.IStringMap aOptions) After creating a Component object, this method should be called to set any parameters used by the component.final booleanisBusy()abstract voidpoll()The abstract message that is called in the defined interval and needs to be overridden by subclasses.voidsetInterval(long nSeconds) Set the interval in seconds.Methods inherited from class com.helger.as2lib.processor.module.AbstractActiveModule
canHandle, equals, forceStop, handle, hashCode, isRunning, start, stop, toStringMethods inherited from class com.helger.as2lib.AbstractDynamicComponent
attrs, getAttributeAsIntRequired, getAttributeAsStringRequired, getName, getSessionMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.as2lib.IDynamicComponent
attrs, getName, getSessionMethods inherited from interface com.helger.as2lib.processor.module.IProcessorActiveModule
isRunning, start, stopMethods inherited from interface com.helger.as2lib.processor.module.IProcessorModule
canHandle, handle
-
Field Details
-
ATTR_POLLING_INTERVAL
The interval in seconds- See Also:
-
-
Constructor Details
-
AbstractActivePollingModule
public AbstractActivePollingModule()
-
-
Method Details
-
initDynamicComponent
@OverridingMethodsMustInvokeSuper public void initDynamicComponent(@Nonnull IAS2Session aSession, @Nullable com.helger.commons.collection.attr.IStringMap aOptions) throws AS2Exception Description copied from interface:IDynamicComponentAfter creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
initDynamicComponentin interfaceIDynamicComponent- Overrides:
initDynamicComponentin classAbstractDynamicComponent- Parameters:
aSession- the component uses this object to access other componentsaOptions- configuration values for the component. All parameters will be stored as attributes of this component. All attributes existing before this method is called will be removed!- Throws:
AS2Exception- If an error occurs while initializing the componentAS2InvalidParameterException- If a required parameter is null in the parameters Map- See Also:
-
setInterval
public void setInterval(long nSeconds) Set the interval in seconds.- Parameters:
nSeconds- Seconds to wait between polling.
-
getInterval
- Returns:
- The seconds between polling operations.
-
isBusy
public final boolean isBusy() -
poll
public abstract void poll()The abstract message that is called in the defined interval and needs to be overridden by subclasses. -
doStart
Description copied from class:AbstractActiveModuleImplement the internal start logic.- Specified by:
doStartin classAbstractActiveModule- Throws:
AS2Exception- In case of an error.
-
doStop
Description copied from class:AbstractActiveModuleImplement the internal stop logic.- Specified by:
doStopin classAbstractActiveModule- Throws:
AS2Exception- In case of an error.
-