|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.geosolutions.geobatch.catalog.impl.BaseIdentifiable
it.geosolutions.geobatch.catalog.impl.BaseResource
it.geosolutions.geobatch.flow.event.consumer.BaseEventConsumer<XEO,ECC>
public abstract class BaseEventConsumer<XEO extends java.util.EventObject,ECC extends EventConsumerConfiguration>
| Nested Class Summary | |
|---|---|
protected class |
BaseEventConsumer.EventConsumerListenerForwarder
|
| Field Summary | |
|---|---|
protected java.util.List<BaseAction<XEO>> |
actions
|
protected BaseAction<XEO> |
currentAction
|
protected java.util.Queue<XEO> |
eventsQueue
The MailBox |
protected BaseEventConsumer.EventConsumerListenerForwarder |
listenerForwarder
|
protected PauseHandler |
pauseHandler
|
| Constructor Summary | |
|---|---|
BaseEventConsumer(java.lang.String id,
java.lang.String name,
java.lang.String description)
|
|
| Method Summary | |
|---|---|
protected void |
addActions(java.util.List<BaseAction<XEO>> actions)
|
void |
addListener(EventConsumerListener listener)
Add listener to this consumer. |
protected java.util.Queue<XEO> |
applyActions(java.util.Queue<XEO> events)
Once the configuring state has been successfully passed, by collecting all the necessary Events, the EventConsumer invokes this method in order to run the related actions. |
boolean |
consume(XEO event)
EventConsumer |
void |
dispose()
Clean up code for this EventConsumer. |
java.util.List<BaseAction<XEO>> |
getActions()
|
java.util.Calendar |
getCreationTimestamp()
|
Action<XEO> |
getCurrentAction()
|
protected ProgressListenerForwarder |
getListenerForwarder()
|
IProgressListener |
getProgressListener(java.lang.Class<IProgressListener> clazz)
|
java.lang.String |
getRunningContext()
|
EventConsumerStatus |
getStatus()
Retrieves the status for this EventConsumer . |
boolean |
isPaused()
|
boolean |
pause()
Pause the execution of a Job. Implementations may also completely ignore the pause() call -- for instance the job may not be split in execution steps, loop iterations and so on; in this case the pause() invocation may simply return false, indicating to the caller that the job was not paused. |
boolean |
pause(boolean sub)
Pause the execution of a Job and optionally all of its subjobs. |
void |
removeListener(EventConsumerListener listener)
Remove listener from this file monitor. |
void |
resume()
Resume a previously paused job. |
void |
setRunningContext(java.lang.String runningContext)
|
protected void |
setStatus(EventConsumerStatus eventConsumerStatus)
Change status and fire events on listeners if status has really changed. |
| Methods inherited from class it.geosolutions.geobatch.catalog.impl.BaseIdentifiable |
|---|
clone, getDescription, getId, getName, setDescription, setId, setName |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.concurrent.Callable |
|---|
call |
| Methods inherited from interface it.geosolutions.geobatch.flow.event.consumer.EventConsumer |
|---|
cancel, getConfiguration, isCanceled, setConfiguration |
| Methods inherited from interface it.geosolutions.geobatch.catalog.Identifiable |
|---|
getDescription, getId, getName, setDescription, setId, setName |
| Field Detail |
|---|
protected final java.util.Queue<XEO extends java.util.EventObject> eventsQueue
protected final java.util.List<BaseAction<XEO extends java.util.EventObject>> actions
protected volatile BaseAction<XEO extends java.util.EventObject> currentAction
protected final BaseEventConsumer.EventConsumerListenerForwarder listenerForwarder
protected PauseHandler pauseHandler
| Constructor Detail |
|---|
public BaseEventConsumer(java.lang.String id,
java.lang.String name,
java.lang.String description)
| Method Detail |
|---|
public java.lang.String getRunningContext()
public void setRunningContext(java.lang.String runningContext)
runningContext - the runningContext to setpublic java.util.Calendar getCreationTimestamp()
public EventConsumerStatus getStatus()
EventConsumerEventConsumer .
getStatus in interface EventConsumer<XEO extends java.util.EventObject,ECC extends EventConsumerConfiguration>EventConsumer .protected void setStatus(EventConsumerStatus eventConsumerStatus)
public Action<XEO> getCurrentAction()
public boolean consume(XEO event)
EventConsumer
consume in interface EventConsumer<XEO extends java.util.EventObject,ECC extends EventConsumerConfiguration>event - The event to consume
true if we can consume the provided event, false otherwise.
protected java.util.Queue<XEO> applyActions(java.util.Queue<XEO> events)
throws ActionException
FIXME: on action errors the flow used to go on. Now it bails
out from the loop.
We may need to specify on a per-action basis if an error in the action
should stop the whole flow.
events - The incoming event queue to pass to the first actionrunningContext - The context in which the actions should be executed
ActionExceptionpublic boolean pause()
Job
pause in interface Jobpublic boolean pause(boolean sub)
Jobpause(false) is equivalent to pause()
pause in interface Jobsub - when true, also subtasks will be paused.
public void resume()
Job
resume in interface Jobpublic boolean isPaused()
isPaused in interface Jobpublic java.util.List<BaseAction<XEO>> getActions()
protected void addActions(java.util.List<BaseAction<XEO>> actions)
public void dispose()
EventConsumerEventConsumer.
dispose in interface Resourcedispose in interface EventConsumer<XEO extends java.util.EventObject,ECC extends EventConsumerConfiguration>dispose in class BaseResourcepublic void addListener(EventConsumerListener listener)
addListener in interface ListenerRegistry<EventConsumerListener>fileListener - Listener to add.public void removeListener(EventConsumerListener listener)
removeListener in interface ListenerRegistry<EventConsumerListener>listener - Listener to remove.protected ProgressListenerForwarder getListenerForwarder()
public IProgressListener getProgressListener(java.lang.Class<IProgressListener> clazz)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||