Disconnects from the server. Use to shut the connection when you're finished with the Client. @webref client @webBrief Disconnects from the server @usage application
()
| 156 | * @usage application |
| 157 | */ |
| 158 | public void stop() { |
| 159 | if (disconnectEventMethod != null && thread != null){ |
| 160 | try { |
| 161 | disconnectEventMethod.invoke(parent, this); |
| 162 | } catch (Exception e) { |
| 163 | Throwable cause = e; |
| 164 | // unwrap the exception if it came from the user code |
| 165 | if (e instanceof InvocationTargetException && e.getCause() != null) { |
| 166 | cause = e.getCause(); |
| 167 | } |
| 168 | cause.printStackTrace(); |
| 169 | disconnectEventMethod = null; |
| 170 | } |
| 171 | } |
| 172 | if (disposeRegistered) { |
| 173 | parent.unregisterMethod("dispose", this); |
| 174 | disposeRegistered = false; |
| 175 | } |
| 176 | dispose(); |
| 177 | } |
| 178 | |
| 179 | |
| 180 | /** |
no test coverage detected