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
public abstract class AbstractActivePollingModule extends AbstractActiveReceiverModule
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_POLLING_INTERVAL
The interval in seconds-
Fields inherited from class com.helger.as2lib.AbstractDynamicComponent
m_aRWLock
-
-
Constructor Summary
Constructors Constructor Description AbstractActivePollingModule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
doStart()
Implement the internal start logic.void
doStop()
Implement the internal stop logic.long
getInterval()
void
initDynamicComponent(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.boolean
isBusy()
abstract void
poll()
The abstract message that is called in the defined interval and needs to be overridden by subclasses.void
setInterval(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, 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
-
Methods inherited from interface com.helger.as2lib.processor.module.IProcessorActiveModule
isRunning, start, stop
-
Methods inherited from interface com.helger.as2lib.processor.module.IProcessorModule
canHandle, handle
-
-
-
-
Field Detail
-
ATTR_POLLING_INTERVAL
public static final String ATTR_POLLING_INTERVAL
The interval in seconds- See Also:
- Constant Field Values
-
-
Method Detail
-
initDynamicComponent
@OverridingMethodsMustInvokeSuper public void initDynamicComponent(@Nonnull IAS2Session aSession, @Nullable com.helger.commons.collection.attr.IStringMap aOptions) throws AS2Exception
Description copied from interface:IDynamicComponent
After 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:
initDynamicComponent
in interfaceIDynamicComponent
- Overrides:
initDynamicComponent
in 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:
IAS2Session
-
setInterval
public void setInterval(long nSeconds)
Set the interval in seconds.- Parameters:
nSeconds
- Seconds to wait between polling.
-
getInterval
@CheckForSigned public long 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
public void doStart() throws AS2Exception
Description copied from class:AbstractActiveModule
Implement the internal start logic.- Specified by:
doStart
in classAbstractActiveModule
- Throws:
AS2Exception
- In case of an error.
-
doStop
public void doStop() throws AS2Exception
Description copied from class:AbstractActiveModule
Implement the internal stop logic.- Specified by:
doStop
in classAbstractActiveModule
- Throws:
AS2Exception
- In case of an error.
-
-