it.geosolutions.geobatch.flow.event
Class ProgressListenerForwarder

java.lang.Object
  extended by it.geosolutions.geobatch.flow.event.ProgressListener
      extended by it.geosolutions.geobatch.flow.event.ProgressListenerForwarder
All Implemented Interfaces:
IProgressListener, ListenerRegistry<IProgressListener>, java.util.EventListener
Direct Known Subclasses:
BaseEventConsumer.EventConsumerListenerForwarder

public class ProgressListenerForwarder
extends ProgressListener
implements ListenerRegistry<IProgressListener>

Dispatch ProgressListener events to registered sublistener.
Events are delivered to all the listener in sequence, first to the first registered and so on.

Author:
ETj

Field Summary
protected  java.util.List<IProgressListener> listeners
          The list of the registered sublisteners that will get the events.
protected static org.slf4j.Logger LOGGER
           
 
Fields inherited from class it.geosolutions.geobatch.flow.event.ProgressListener
configuration
 
Constructor Summary
ProgressListenerForwarder(Identifiable owner)
           
 
Method Summary
 void addListener(IProgressListener listener)
           
 void completed()
          The process has successfully ended.
 void failed(java.lang.Throwable exception)
          The process has ended with an error
 java.util.List<? extends IProgressListener> getListeners()
           
 float getProgress()
          Get a progress indicator, between 0.0 and 100.0
 java.lang.String getTask()
          Get the name of the current task.
 void paused()
          The process has been paused
 void progressing()
          Call progressing on all the handled
 void progressing(float progress, java.lang.String task)
          A shortcut to set some info and call progressing();
 void removeListener(IProgressListener listener)
           
 void resumed()
          The process has been resumed
 void setProgress(float progress)
          Used by the notifier.
 void setTask(java.lang.String currentTask)
          Used by the notifier.
 void started()
          The process has been started
 void terminated()
          The process has been terminated
 
Methods inherited from class it.geosolutions.geobatch.flow.event.ProgressListener
getOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.slf4j.Logger LOGGER

listeners

protected java.util.List<IProgressListener> listeners
The list of the registered sublisteners that will get the events.

Constructor Detail

ProgressListenerForwarder

public ProgressListenerForwarder(Identifiable owner)
Method Detail

progressing

public void progressing(float progress,
                        java.lang.String task)
A shortcut to set some info and call progressing();


completed

public void completed()
Description copied from interface: IProgressListener
The process has successfully ended.

Specified by:
completed in interface IProgressListener

failed

public void failed(java.lang.Throwable exception)
Description copied from interface: IProgressListener
The process has ended with an error

Specified by:
failed in interface IProgressListener

getProgress

public float getProgress()
Description copied from interface: IProgressListener
Get a progress indicator, between 0.0 and 100.0

Specified by:
getProgress in interface IProgressListener
Overrides:
getProgress in class ProgressListener

getTask

public java.lang.String getTask()
Description copied from interface: IProgressListener
Get the name of the current task.

Specified by:
getTask in interface IProgressListener
Overrides:
getTask in class ProgressListener

paused

public void paused()
Description copied from interface: IProgressListener
The process has been paused

Specified by:
paused in interface IProgressListener

progressing

public void progressing()
Call progressing on all the handled

Specified by:
progressing in interface IProgressListener
See Also:
IProgressListener.getProgress(), IProgressListener.getTask()

resumed

public void resumed()
Description copied from interface: IProgressListener
The process has been resumed

Specified by:
resumed in interface IProgressListener

setProgress

public void setProgress(float progress)
Description copied from class: ProgressListener
Used by the notifier.

Specified by:
setProgress in interface IProgressListener
Overrides:
setProgress in class ProgressListener

setTask

public void setTask(java.lang.String currentTask)
Description copied from class: ProgressListener
Used by the notifier.

Specified by:
setTask in interface IProgressListener
Overrides:
setTask in class ProgressListener

started

public void started()
Description copied from interface: IProgressListener
The process has been started

Specified by:
started in interface IProgressListener

terminated

public void terminated()
Description copied from interface: IProgressListener
The process has been terminated

Specified by:
terminated in interface IProgressListener

addListener

public void addListener(IProgressListener listener)
Specified by:
addListener in interface ListenerRegistry<IProgressListener>

removeListener

public void removeListener(IProgressListener listener)
Specified by:
removeListener in interface ListenerRegistry<IProgressListener>

getListeners

public java.util.List<? extends IProgressListener> getListeners()


Copyright © 2008-2012 GeoSolutions. All Rights Reserved.