public class BusClient extends BusBase
Bus
implementation which acts as a client to an existing server
implementation. This means that new notifications are only sent to local
receivers as well as to a single BusConnection
connecting with the
server.BusBase.ReceiveThread
Bus.NotificationReceiver
Activatable.State
Constructor and Description |
---|
BusClient(SocketOptions options)
Constructs a bus that is client of an active server.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
void |
handleIncoming(NotificationType.Notification notification,
BusConnection source)
Implement this method to specify the behavior in case of an incoming
notification received from a connection.
|
boolean |
isActive()
Tells whether this class is currently active or not.
|
addConnection, addNotificationReceiver, getSocketOptions, getTransportUri, handleGlobally, handleGlobally, handleIncoming, handleLocally, handleOutgoing, numberOfConnections, removeConnection, removeNotificationReceiver
public BusClient(SocketOptions options)
options
- socket options to use for the connectionpublic void activate() throws RSBException
Activatable
RSBException
- generic error related to RSBpublic void deactivate() throws RSBException, InterruptedException
Activatable
deactivate
in interface Activatable
deactivate
in class BusBase
RSBException
- generic error related to RSBInterruptedException
- interrupted while waiting for proper deactivation. Object
might be in an undefined state nowpublic boolean isActive()
Activatable
true
if activepublic void handleIncoming(NotificationType.Notification notification, BusConnection source) throws RSBException
BusBase
BusBase.handleLocally(rsb.protocol.NotificationType.Notification)
and
BusBase.handleGlobally(rsb.protocol.NotificationType.Notification)
to
implement their processing logic.handleIncoming
in class BusBase
notification
- the received connectionsource
- the source BusConnection
providing this NotificationRSBException
- processing errorCopyright © 2018 CoR-Lab. All rights reserved.