protected class BackgroundPushAPI.BackgroundWorker
extends java.lang.Object
implements java.io.Flushable, java.io.Closeable
Modifier and Type | Class and Description |
---|---|
protected class |
BackgroundPushAPI.BackgroundWorker.BackgroundWorkerThread
Thread Background runner.
|
Modifier and Type | Field and Description |
---|---|
protected long |
currentBytes |
protected int |
currentCount |
protected PushAPIException |
exception |
protected boolean |
exit |
protected boolean |
isStarted |
protected boolean |
isWorking |
protected java.util.ArrayList<BackgroundPushAPI.BackgroundWorkerItem> |
items |
protected long |
lastWorkTick |
protected BackgroundPushAPI.BackgroundWorker.BackgroundWorkerThread |
thread |
protected java.util.HashMap<java.lang.Long,java.lang.Long> |
tickThread |
Constructor and Description |
---|
BackgroundWorker()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the BackgroundPushAPI object.
|
void |
exit()
Request exit of worker thread.
|
protected void |
exitUnsync()
exit() unsynchronized.
|
void |
flush()
Flush (ie.
|
void |
flushAll()
Flush (ie.
|
void |
flushCurrent()
Flush current (ie.
|
void |
push(BackgroundPushAPI.BackgroundWorkerItem item)
Push an operation.
|
protected void |
start()
Start thread.
|
void |
startWorker()
Ensure worker thread is started.
|
void |
stopWorker()
Ensure worker thread is ended.
|
protected void |
throwIfNotRunning()
Throw an exception if the worker thread is not running.
|
void |
waitEmpty()
Wait for the background queue to be fully empty.
|
protected boolean exit
protected boolean isStarted
protected boolean isWorking
protected PushAPIException exception
protected java.util.ArrayList<BackgroundPushAPI.BackgroundWorkerItem> items
protected int currentCount
protected long currentBytes
protected java.util.HashMap<java.lang.Long,java.lang.Long> tickThread
protected long lastWorkTick
protected BackgroundPushAPI.BackgroundWorker.BackgroundWorkerThread thread
public BackgroundWorker()
protected void throwIfNotRunning() throws PushAPIException
PushAPIException
public void push(BackgroundPushAPI.BackgroundWorkerItem item) throws PushAPIException
PushAPIException
protected void start()
public void startWorker()
public void stopWorker()
public void waitEmpty() throws PushAPIException
PushAPIException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void flushAll() throws PushAPIException
PushAPIException
public void flushCurrent() throws PushAPIException
PushAPIException
protected void exitUnsync()
public void exit()
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
Copyright © 2021 Dassault Systèmes, All Rights Reserved.