rosjava - how get a state/notificaiton of connection to ros-master
I started with pubsub-tutorial, it works fine. Now, I am trying to write my own app with rosjava und need to know current state of connection to ros-master.
Are there a possibility to get this state (connected or not) or to be notificated about change it.
I can see errors in output-window, but I can not handle it:
12-29 19:02:02.398: W/Registrar(4016): Master registration failed and will be retried.
12-29 19:02:02.398: W/Registrar(4016): java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.net.ConnectException: Arbeitslaptop-Ubuntu.fritz.box/192.168.178.30:11311 - Connection refused
12-29 19:02:02.398: W/Registrar(4016): at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:224)
12-29 19:02:02.398: W/Registrar(4016): at java.util.concurrent.FutureTask.get(FutureTask.java:83)
12-29 19:02:02.398: W/Registrar(4016): at org.ros.internal.node.client.Registrar$RetryLoop.loop(Registrar.java:81)
12-29 19:02:02.398: W/Registrar(4016): at org.ros.concurrent.CancellableLoop.run(CancellableLoop.java:47)
12-29 19:02:02.398: W/Registrar(4016): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
12-29 19:02:02.398: W/Registrar(4016): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
12-29 19:02:02.398: W/Registrar(4016): at java.lang.Thread.run(Thread.java:1019)
12-29 19:02:02.398: W/Registrar(4016): Caused by: java.lang.RuntimeException: java.net.ConnectException: Arbeitslaptop-Ubuntu.fritz.box/192.168.178.30:11311 - Connection refused
12-29 19:02:02.398: W/Registrar(4016): at org.ros.internal.node.xmlrpc.XmlRpcClientFactory$1.invoke(XmlRpcClientFactory.java:152)
12-29 19:02:02.398: W/Registrar(4016): at $Proxy0.registerPublisher(Native Method)
12-29 19:02:02.398: W/Registrar(4016): at org.ros.internal.node.client.MasterClient.registerPublisher(MasterClient.java:136)
....
Thank you in advance