T
- The data signature class
V
- The event data class
public class DataHandlerCounterEventData extends EventCounter implements Closeable>
EventDataHandler
. Registers shutdown hook and thread for triggering event processing after wait time.
Constructor and Description |
---|
DataHandlerCounter(EventDataHandler<T,V> dataHandler)
Create an instance with provided data handler and UnknownContext.PERMISSIVE fallback context.
|
DataHandlerCounter(EventDataHandler<T,V> dataHandler, IContext fallback)
Create an instance with provided data handler and fallback context.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Disable all registered hooks and process the left data.
|
protected void |
onEvent(IEvent event, IMetaInfo metaInfo)
Process the event.
|
public DataHandlerCounter(EventDataHandler<T,V> dataHandler)
UnknownContext.PERMISSIVE
fallback context.
dataHandler
- the EventDataHandler
for events handling
public DataHandlerCounter(EventDataHandler<T,V> dataHandler, IContext fallback)
dataHandler
- the EventDataHandler
for events handling
fallback
- the fallback context
protected void onEvent(IEvent event, IMetaInfo metaInfo)
onEvent
in class EventCounter
event
- IEvent
to count
metaInfo
- the IMetaInfo
that can hold information about event origin
IllegalStateException
- if the current instance has been disabled. See close()
public void close()
onEvent(IEvent, IMetaInfo)
method would throw an exception.
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 1998–2021 iText Group NV. All rights reserved.