public class SharedProcessor<ApiType>
extends java.lang.Object
Constructor and Description |
---|
SharedProcessor() |
SharedProcessor(java.util.concurrent.ExecutorService threadPool) |
Modifier and Type | Method and Description |
---|---|
void |
addAndStartListener(ProcessorListener<ApiType> processorListener)
addAndStartListener first adds the specific processorListener then starts the listener with
executor.
|
void |
addListener(ProcessorListener<ApiType> processorListener)
addListener adds the specific processorListener, but not start it.
|
void |
distribute(ProcessorListener.Notification<ApiType> obj,
boolean isSync)
distribute the object among listeners.
|
void |
run()
starts the processor listeners.
|
boolean |
shouldResync() |
void |
stop() |
public SharedProcessor()
public SharedProcessor(java.util.concurrent.ExecutorService threadPool)
public void addAndStartListener(ProcessorListener<ApiType> processorListener)
processorListener
- specific processor listenerpublic void addListener(ProcessorListener<ApiType> processorListener)
processorListener
- specific processor listenerpublic void run()
public void distribute(ProcessorListener.Notification<ApiType> obj, boolean isSync)
obj
- specific objisSync
- is sync or notpublic boolean shouldResync()
public void stop()
Copyright © 2019. All rights reserved.