public class SelectAccountMessage
extends java.lang.Object
Layer1ApiAdminListener.onUserMessage(Object)
Modifier and Type | Field and Description |
---|---|
AccountInfo[] |
accountsInfo
Array of accounts to select from
|
private java.util.concurrent.CountDownLatch |
latch |
private int |
selectedIndex |
private java.lang.Object |
selectedIndexLock |
Constructor and Description |
---|
SelectAccountMessage(AccountInfo[] accountsInfo)
Constructs new account selection request
|
Modifier and Type | Method and Description |
---|---|
int |
get()
Waits till selection is done and returns index of account that was
selected.
|
void |
set(int selectedIndex)
Sets selected account index after selection is performed.
|
public final AccountInfo[] accountsInfo
private final java.util.concurrent.CountDownLatch latch
private int selectedIndex
private java.lang.Object selectedIndexLock
public SelectAccountMessage(AccountInfo[] accountsInfo)
accountsInfo
- accounts to select frompublic void set(int selectedIndex)
get()
calls and prevents
blocking further ones.selectedIndex
- index in accountsInfo
arraypublic int get() throws java.lang.InterruptedException
SelectAccountMessage(AccountInfo[])
and available as accountsInfo
java.lang.InterruptedException
- if the current thread is interrupted while waiting