it.geosolutions.geobatch.flow.event.action
Class BaseAction<XEO extends java.util.EventObject>
java.lang.Object
it.geosolutions.geobatch.catalog.impl.BaseIdentifiable
it.geosolutions.geobatch.flow.event.action.BaseAction<XEO>
- Type Parameters:
XEO - Kind of EventObject to be eXecuted
- All Implemented Interfaces:
- Identifiable, Action<XEO>, Job, ListenerRegistry<ProgressListener>, java.lang.Cloneable
public abstract class BaseAction<XEO extends java.util.EventObject>
- extends BaseIdentifiable
- implements Action<XEO>, Job
- Version:
- r1
r2 - on: 26 Aug 2011
- Author:
- Simone Giannecchini, GeoSolutions S.A.S., (r2) Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
|
Method Summary |
void |
addListener(ProgressListener listener)
|
void |
destroy()
|
|
getProgressListener(java.lang.Class<PL> clazz)
|
java.lang.String |
getRunningContext()
|
boolean |
isFailIgnored()
Tells if an exception in this Actions should not break the entire flow. |
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(ProgressListener listener)
|
void |
resume()
Resume a previously paused job. |
void |
setFailIgnored(boolean failIgnored)
|
void |
setRunningContext(java.lang.String runningContext)
|
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface it.geosolutions.geobatch.flow.event.action.Action |
execute |
listenerForwarder
protected final ProgressListenerForwarder listenerForwarder
failIgnored
protected boolean failIgnored
BaseAction
public BaseAction(java.lang.String id,
java.lang.String name,
java.lang.String description)
BaseAction
public BaseAction(ActionConfiguration actionConfiguration)
getRunningContext
public java.lang.String getRunningContext()
- Returns:
- the runningContext
setRunningContext
public void setRunningContext(java.lang.String runningContext)
- Parameters:
runningContext - the runningContext to set
destroy
public void destroy()
- Specified by:
destroy in interface Action<XEO extends java.util.EventObject>
isPaused
public boolean isPaused()
- Specified by:
isPaused in interface Job
pause
public boolean pause()
- Description copied from interface:
Job
- 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.
- Specified by:
pause in interface Job
- Returns:
- true if the Job has been successfully paused.
pause
public boolean pause(boolean sub)
- Description copied from interface:
Job
- Pause the execution of a Job and optionally all of its subjobs.
A Job may control other subjobs running asynchronally.
When sub is true, also the subjobs will be paused.
pause(false) is equivalent to pause()
- Specified by:
pause in interface Job
- Parameters:
sub - when true, also subtasks will be paused.
- Returns:
- true if the Job has been successfully paused, disregarding any return values
from its subjobs.
resume
public void resume()
- Description copied from interface:
Job
- Resume a previously paused job.
If the instance does not support pausing or it was not paused, nothing will happen.
- Specified by:
resume in interface Job
isFailIgnored
public boolean isFailIgnored()
- Description copied from interface:
Action
- Tells if an exception in this Actions should not break the entire flow.
Defaults to false.
Some somehow "minor" actions would not break the logical flow, for instance a remote file
deletion via FTP.
- Specified by:
isFailIgnored in interface Action<XEO extends java.util.EventObject>
- Returns:
setFailIgnored
public void setFailIgnored(boolean failIgnored)
- Parameters:
failIgnored -
removeListener
public void removeListener(ProgressListener listener)
- Specified by:
removeListener in interface ListenerRegistry<ProgressListener>
addListener
public void addListener(ProgressListener listener)
- Specified by:
addListener in interface ListenerRegistry<ProgressListener>
getProgressListener
public <PL extends IProgressListener> PL getProgressListener(java.lang.Class<PL> clazz)
Copyright © 2008-2012 GeoSolutions. All Rights Reserved.