public class SharedProcessor<T> extends Object
Constructor and Description |
---|
SharedProcessor() |
SharedProcessor(ExecutorService threadPool) |
Modifier and Type | Method and Description |
---|---|
void |
addAndStartListener(ProcessorListener<T> processorListener)
First adds the specific processorListener then starts the listener
with executor.
|
void |
addListener(ProcessorListener<T> processorListener)
Adds the specific processorListener, but not start it.
|
void |
distribute(ProcessorListener.Notification<T> obj,
boolean isSync)
Distribute the object amount listeners.
|
void |
run()
Starts the processor listeners.
|
boolean |
shouldResync() |
void |
stop() |
public SharedProcessor()
public SharedProcessor(ExecutorService threadPool)
public void addAndStartListener(ProcessorListener<T> processorListener)
processorListener
- specific processor listenerpublic void addListener(ProcessorListener<T> processorListener)
processorListener
- specific processor listenerpublic void run()
public void distribute(ProcessorListener.Notification<T> obj, boolean isSync)
obj
- specific objisSync
- whether in sync or notpublic boolean shouldResync()
public void stop()
Copyright © 2015–2020 Red Hat. All rights reserved.