com.kuka.roboticsAPI.controllerModel.sunrise.connectionLib
Class ConnectionListener

java.lang.Object
  extended by com.kuka.roboticsAPI.controllerModel.sunrise.connectionLib.ConnectionListener

public class ConnectionListener
extends Object

A connection listener connects a message handler and a connection lib channel using a ConnectionReceiver and HandlingWorker.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

Constructor Summary
ConnectionListener(Connection inChannel, IMessageHandler handler)
          Creates a new ConnectionListener with a single handling thread.
ConnectionListener(Connection inChannel, IMessageHandler handler, int workerCount)
          Creates a new ConnectionListener.
 
Method Summary
 void dispose()
          Disposes the listener.
 boolean isConnected()
          Checks if the listener is active, which means that the connection is still active.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionListener

public ConnectionListener(Connection inChannel,
                          IMessageHandler handler)
Creates a new ConnectionListener with a single handling thread.

Starts immediately to listen for messages on the given channel. If a message is received, the given handler is called.

Parameters:
inChannel - The channel on which messages are received.
handler - The handler which handles incoming messages
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

ConnectionListener

public ConnectionListener(Connection inChannel,
                          IMessageHandler handler,
                          int workerCount)
Creates a new ConnectionListener.

Starts immediately to listen for messages on the given channel. If a message is received, the given handler is called.

Parameters:
inChannel - The channel on which messages are received.
handler - The handler which handles incoming messages
workerCount - The worker count defines how many threads will be used to handle the messages and pass them to the defined message handler. If the value is greater than 1, the handler must be thread-safe, because messages will be handled in parallel!
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.
Method Detail

dispose

public void dispose()
Disposes the listener. Stops listener and does close the connection.

Will not throw an exception.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isConnected

public boolean isConnected()
Checks if the listener is active, which means that the connection is still active.

Returns:
True if the connection is connected.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.


Copyright © 2019. All rights reserved.