public class SharedProcessor<T> extends Object
Constructor and Description |
---|
SharedProcessor() |
SharedProcessor(Executor executor,
String informerDescription) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ProcessorListener<T> processorListener)
Adds the specific processorListener
|
ProcessorListener<T> |
addProcessorListener(ResourceEventHandler<? super T> handler,
long resyncPeriodMillis,
Supplier<Collection<T>> initialItems)
Adds a new listener.
|
void |
distribute(Consumer<ProcessorListener<T>> operation,
boolean isSync)
Distribute the operation to the respective listeners
|
void |
distribute(ProcessorListener.Notification<T> obj,
boolean isSync)
Distribute the object amount listeners.
|
boolean |
shouldResync() |
void |
stop() |
public void addListener(ProcessorListener<T> processorListener)
processorListener
- specific processor listenerpublic void distribute(ProcessorListener.Notification<T> obj, boolean isSync)
obj
- specific objisSync
- whether in sync or notpublic void distribute(Consumer<ProcessorListener<T>> operation, boolean isSync)
public boolean shouldResync()
public void stop()
public ProcessorListener<T> addProcessorListener(ResourceEventHandler<? super T> handler, long resyncPeriodMillis, Supplier<Collection<T>> initialItems)
Copyright © 2015–2023 Red Hat. All rights reserved.