Package adams.flow.core
Class EventHelper
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.flow.core.EventHelper
-
- All Implemented Interfaces:
LoggingSupporter
,SizeOfHandler
,Serializable
public class EventHelper extends LoggingObject
Helper class for events. You can place "quartz.properties" or "quartz.props" on the classpath to customize the settings of the scheduler.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static Map<Integer,org.quartz.impl.StdSchedulerFactory>
m_SchedulerFactory
the scheduler factory.-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description EventHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Actor
findEvent(ActorHandler group, EventReference name)
Checks a control actor's children whether they contain the event that we're looking for.Actor
findEvent(Actor root, EventReference name)
Tries to find the event referenced by its global name.Actor
findEventRecursive(Actor actor, EventReference name)
Tries to find the referenced event.static org.quartz.Scheduler
getDefaultScheduler(int flowID)
Synchronized access for the default scheduler.-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
findEvent
public Actor findEvent(ActorHandler group, EventReference name)
Checks a control actor's children whether they contain the event that we're looking for.- Parameters:
group
- the group to checkname
- the name of the event- Returns:
- the event or null if not found
-
findEvent
public Actor findEvent(Actor root, EventReference name)
Tries to find the event referenced by its global name.- Parameters:
root
- the root to search inname
- the name of the event- Returns:
- the event or null if not found
-
findEventRecursive
public Actor findEventRecursive(Actor actor, EventReference name)
Tries to find the referenced event. First all possible actor handlers are located recursively (up to the root) that allow also singletons. This list of actors is then searched for the event.- Parameters:
actor
- the actor to start fromname
- the name of the event- Returns:
- the event or null if not found
- See Also:
ActorUtils.findActorHandlers(Actor, boolean)
-
getDefaultScheduler
public static org.quartz.Scheduler getDefaultScheduler(int flowID) throws org.quartz.SchedulerException
Synchronized access for the default scheduler.- Parameters:
flowID
- the flow ID is the ID of the scheduler- Returns:
- the default scheduler
- Throws:
org.quartz.SchedulerException
- if scheduler cannot be initialized
-
-