Package org.openas2.schedule
Class SchedulerComponent
- java.lang.Object
-
- org.openas2.BaseComponent
-
- org.openas2.schedule.SchedulerComponent
-
- All Implemented Interfaces:
Component
public class SchedulerComponent extends BaseComponent
Scheduler module for periodic tasks.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.ScheduledExecutorService
executorService
private org.apache.commons.logging.Log
logger
private static int
MIN_AMOUNT_OF_THREADS
static java.lang.String
PARAMETER_THREADS
-
Constructor Summary
Constructors Constructor Description SchedulerComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
createExecutor()
void
destroy()
Component lifecycle hook.void
init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters)
Component lifecycle hook.private void
scheduleComponentsTasks(Session session)
private void
scheduleModuleTasks(Session session)
-
Methods inherited from class org.openas2.BaseComponent
getName, getParameter, getParameter, getParameterInt, getParameters, getSession, setParameter, setParameter
-
-
-
-
Field Detail
-
PARAMETER_THREADS
public static final java.lang.String PARAMETER_THREADS
- See Also:
- Constant Field Values
-
MIN_AMOUNT_OF_THREADS
private static final int MIN_AMOUNT_OF_THREADS
- See Also:
- Constant Field Values
-
logger
private org.apache.commons.logging.Log logger
-
executorService
private java.util.concurrent.ScheduledExecutorService executorService
-
-
Method Detail
-
init
public void init(Session session, java.util.Map<java.lang.String,java.lang.String> parameters) throws OpenAS2Exception
Description copied from interface:Component
Component lifecycle hook. 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:
init
in interfaceComponent
- Overrides:
init
in classBaseComponent
- Parameters:
session
- the component uses this object to access other componentsparameters
- configuration values for the component- Throws:
OpenAS2Exception
- If an error occurs while initializing the component- See Also:
Session
-
createExecutor
private void createExecutor() throws InvalidParameterException
- Throws:
InvalidParameterException
-
scheduleComponentsTasks
private void scheduleComponentsTasks(Session session) throws OpenAS2Exception
- Throws:
OpenAS2Exception
-
scheduleModuleTasks
private void scheduleModuleTasks(Session session) throws OpenAS2Exception
- Throws:
OpenAS2Exception
-
destroy
public void destroy() throws java.lang.Exception
Description copied from interface:Component
Component lifecycle hook. If lifecycle ofComponent
requires a destroy function this method can be used.- Specified by:
destroy
in interfaceComponent
- Overrides:
destroy
in classBaseComponent
- Throws:
java.lang.Exception
- Something went wrong- See Also:
Component.init(Session, Map)
,Session
-
-