Bus

public interface Bus extends Activatable

Instances of this class provide access to a socket-based bus. It is transparent for clients (connectors) of this class whether it is accessed by running the bus server or by connecting to the bus server as a client.

Author

jwienke

Methods

addNotificationReceiver

void addNotificationReceiver(NotificationReceiver receiver)

Registers a local observer for notifications.

Parameters

receiver – the receiver to register

getSocketOptions

SocketOptions getSocketOptions()

Returns the current socket configuration of the bus.

Returns

socket options used

getTransportUri

URI getTransportUri()

Return the URI describing the transport manifested by this bus. Only valid if activated.

Throws

IllegalStateException – instance is in wrong state to prepare the URI

Returns

URI, not null

handleOutgoing

void handleOutgoing(Notification notification)

Handles a notification to be sent over the bus. The default implementation dispatches the notification to all local NotificationReceiver and to all registered BusConnection s.

Parameters

notification – the notification to distribute

Throws

RSBException – error during dispatching

removeNotificationReceiver

void removeNotificationReceiver(NotificationReceiver receiver)

Removes a local observer for notifications if registered before.

Parameters

receiver – the receiver to remove