it.geosolutions.geobatch.flow.event.consumer
Interface EventConsumer<EO extends java.util.EventObject,ECC extends EventConsumerConfiguration>

All Superinterfaces:
Job, ListenerRegistry<EventConsumerListener>
All Known Implementing Classes:
BaseEventConsumer

public interface EventConsumer<EO extends java.util.EventObject,ECC extends EventConsumerConfiguration>
extends ListenerRegistry<EventConsumerListener>, Job

Author:
(r2) Carlo Cancellieri - carlo.cancellieri@geo-solutions.it

Method Summary
 void cancel()
          Asks this EventConsumer to cancel its execution.
 boolean consume(EO event)
          Tries to consume the provided event.
 void dispose()
          Clean up code for this EventConsumer.
 ECC getConfiguration()
          Retrieves the configuration for this EventConsumer.
 EventConsumerStatus getStatus()
          Retrieves the status for this EventConsumer .
 boolean isCanceled()
          Tells us whether or not this EventConsumer was asked to cancel its execution.
 void setConfiguration(ECC configuration)
          Sets the configuration for this EventConsumer.
 
Methods inherited from interface it.geosolutions.geobatch.misc.ListenerRegistry
addListener, removeListener
 
Methods inherited from interface it.geosolutions.geobatch.flow.Job
isPaused, pause, pause, resume
 

Method Detail

dispose

void dispose()
Clean up code for this EventConsumer.


getConfiguration

ECC getConfiguration()
Retrieves the configuration for this EventConsumer.

Returns:
the configuration for this EventConsumer.

setConfiguration

void setConfiguration(ECC configuration)
Sets the configuration for this EventConsumer.

Parameters:
configuration - to set for this EventConsumer.

getStatus

EventConsumerStatus getStatus()
Retrieves the status for this EventConsumer .

Returns:
the status for this EventConsumer .

consume

boolean consume(EO event)
Tries to consume the provided event. In case the provided event cannot be consumed it return false.

Parameters:
event - The event to consume
Returns:
true if we can consume the provided event, false otherwise.

cancel

void cancel()
Asks this EventConsumer to cancel its execution.


isCanceled

boolean isCanceled()
Tells us whether or not this EventConsumer was asked to cancel its execution.

Returns:
true in case this EventConsumer was asked to cancel its execution, false otherwise.


Copyright © 2008-2012 GeoSolutions. All Rights Reserved.