Annotation Interface Broadcast


@Retention(RUNTIME) @Target(TYPE) public @interface Broadcast
Enables broadcast messaging for an Agent or Role. Agent can send messages to all subscribers of a topic.

Internal Mode:

 @Broadcast(topic = "updates")
 public class PublisherAgent extends Agent {
     // Broadcasts to all internal subscribers
 }
 

Remote Mode:

 @Broadcast(topic = "updates", broker = "http://broker:9090")
 public class RemotePublisher extends Agent {
     // Broadcasts via remote message broker
 }
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Broadcast topic/channel name.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Remote message broker URL.
    boolean
    Whether this agent can publish to the topic.
    boolean
    Whether this agent can subscribe to the topic.
    Transport mode.
  • Element Details

    • topic

      String topic
      Broadcast topic/channel name.
    • broker

      String broker
      Remote message broker URL. If empty, uses internal broker.
      Default:
      ""
    • transport

      TransportMode transport
      Transport mode.
      Default:
      AUTO
    • canPublish

      boolean canPublish
      Whether this agent can publish to the topic.
      Default:
      true
    • canSubscribe

      boolean canSubscribe
      Whether this agent can subscribe to the topic.
      Default:
      true