
public interface BusMessagingLayer extends Closeable, MessagingLayer
| Modifier and Type | Method and Description |
|---|---|
void |
addMessageListener(String agentName,
BusMessageForwarder forwarder,
Bus... buses)
Sets up callback configuration for a topic and subsystem.
|
void |
close()
Close the Transport Layer.
|
void |
closeFor(String agentName,
Bus... buses)
close entry points for a bus for an agent.
|
default Set<String> |
getRegisteredLocalAgents()
Get the list of local agents currently connected to all buses.
|
Set<String> |
getRegisteredLocalAgents(Bus... buses)
Get the list of local agents currently connected to the buses.
|
static String |
parseDestination(String destination)
utility method: parse the destination string in Commands.
|
void |
register(String agentName,
Bus... buses)
Creates low level communication entry points for a subsystem.
|
void |
removeMessageListener(String agentName,
BusMessageForwarder forwarder,
Bus... buses)
Removes a message listener from the forwarder list.
|
connect, disconnect, sendMessagestatic String parseDestination(String destination)
destination - the complete destination (e.g : "sft/carousel")void register(String agentName, Bus... buses) throws IOException, DuplicateAgentNameException
agentName - name of the sending/receiving point as will be known by transport
null or empty string means that the local agent will receive all messages
(whatever the destination of the message is : "anonymous agent")
if an agent with same name is already locally registered for these buses nothing happens (the call is
idempotent), but if another agent has the same name on the network a DuplicateBusNameException
may be fired (this is an optional behaviour) but this exception is reported only to the corresponding
BusMembershipListenerbuses - list of buses we want to connect to, if empty connects to all busesIOException - if connection impossible,DuplicateAgentNameExceptionvoid closeFor(String agentName, Bus... buses)
agentName - (if empty voids the "anonymous" agent capabilitiesbuses - if empty all registered buses for the agent will be closedIllegalArgumentException - if you do not "own" the agent corresponding to the name.Set<String> getRegisteredLocalAgents(Bus... buses)
buses - The buses for which we are seeking the connected agents.
If empty it will report agents connected to all buses.IOExceptiondefault Set<String> getRegisteredLocalAgents()
IOExceptionvoid close()
throws IOException
close in interface AutoCloseableclose in interface CloseableIOExceptionvoid addMessageListener(String agentName, BusMessageForwarder forwarder, Bus... buses)
agentName - if empty adds a forwarder to "anonymous" agent that receives all messagesforwarder - code that handles the incoming messagesbuses - if empty the forwarder listens to all buses.IllegalArgumentException - if the subsystem is not registered to one of the buses
or if forwarder is nullvoid removeMessageListener(String agentName, BusMessageForwarder forwarder, Bus... buses)
agentName - forwarder - buses - if empty forwarder is removed from all busesIllegalArgumentException - if forwarder is null
(but no exception if the subsystem is not registered, or forwarder not present)Copyright © 2016 LSST. All rights reserved.