public class MessageLoopThread
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static com.jniwrapper.util.Logger |
_log |
Constructor and Description |
---|
MessageLoopThread()
Creates message loop instance.
|
MessageLoopThread(boolean daemon)
Creates a message loop instance.
|
MessageLoopThread(java.lang.String name)
Creates message loop instance.
|
MessageLoopThread(java.lang.String name,
boolean daemon) |
Modifier and Type | Method and Description |
---|---|
void |
doAddMessageListener(MessageLoopListener listener)
Adds message listener for the message loop.
|
void |
doInvokeAndWait(java.lang.Runnable action)
Invokes the action in the message loop and waits until action executes.
|
void |
doInvokeLater(java.lang.Runnable action)
Invokes the action in the message loop.
|
java.lang.Object |
doInvokeMethod(java.lang.Object object,
java.lang.String methodName)
Invokes the method in the message loop and waits until the method executes.
|
java.lang.Object |
doInvokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object[] parameters)
Invokes the method in the message loop and waits until the method executes.
|
void |
doRemoveMessageListener(MessageLoopListener listener)
Removes message listener for the message loop.
|
void |
doStart()
Starts the message loop.
|
void |
doStop()
Stops the message loop.
|
protected static java.util.Map |
getMessageLoops() |
java.lang.String |
getName()
Returns name of this thread.
|
boolean |
isDispatchThread()
Returns true if current thread is main message loop.
|
boolean |
isStarted() |
protected void |
onStart() |
protected void |
onStop() |
protected void |
pingMessageLoopThread() |
protected void |
postSyncThreadMessage(int message,
int wParam,
int lParam)
Deprecated.
This method is incompatible with 64-bit architectures. Use
postSyncThreadMessage(int message, long wParam, long lParam) instead. |
protected void |
postSyncThreadMessage(int message,
long wParam,
long lParam) |
public MessageLoopThread()
public MessageLoopThread(java.lang.String name)
name
- message loop name namepublic MessageLoopThread(boolean daemon)
daemon
- determines if the message loop thread is a daemon thread or not.public MessageLoopThread(java.lang.String name, boolean daemon)
protected static java.util.Map getMessageLoops()
public void doStart()
public void doStop()
public java.lang.String getName()
public boolean isStarted()
public boolean isDispatchThread()
public void doInvokeAndWait(java.lang.Runnable action) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
action
- action to executejava.lang.InterruptedException
java.lang.reflect.InvocationTargetException
protected void pingMessageLoopThread()
public void doInvokeLater(java.lang.Runnable action)
action
- action to executepublic java.lang.Object doInvokeMethod(java.lang.Object object, java.lang.String methodName) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
object
- object which method is calledmethodName
- name of called methodjava.lang.InterruptedException
java.lang.reflect.InvocationTargetException
public java.lang.Object doInvokeMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object[] parameters) throws java.lang.InterruptedException, java.lang.reflect.InvocationTargetException
object
- which method is calledmethodName
- name of called methodparameters
- method parametersjava.lang.InterruptedException
java.lang.reflect.InvocationTargetException
public void doAddMessageListener(MessageLoopListener listener)
listener
- message listenerpublic void doRemoveMessageListener(MessageLoopListener listener)
listener
- message listenerprotected void postSyncThreadMessage(int message, int wParam, int lParam)
postSyncThreadMessage(int message, long wParam, long lParam)
instead.protected void postSyncThreadMessage(int message, long wParam, long lParam)
protected void onStart()
protected void onStop()