Interface MessageChannel


public interface MessageChannel
Represents a pub/sub channel for cross-proxy messaging.

Channels can be either predefined system channels (see Channels) or custom channels created by plugins via Channels.register(String, String).

Usage

// Use predefined channel
messaging.subscribe(Channels.CHAT, handler);

// Create and use custom channel
MessageChannel myChannel = Channels.register("myplugin", "events");
messaging.subscribe(myChannel, handler);
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The namespace used for all system channels.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the unique channel identifier.
    Get the name portion of the channel ID.
    Get the namespace portion of the channel ID.
    default boolean
    Check if this is a system channel (numdrassl namespace).
  • Field Details

  • Method Details

    • getId

      @Nonnull String getId()
      Get the unique channel identifier.

      Format: namespace:name (e.g., "numdrassl:heartbeat" or "myplugin:events")

      Returns:
      the channel identifier
    • getNamespace

      @Nonnull String getNamespace()
      Get the namespace portion of the channel ID.
      Returns:
      the namespace (e.g., "numdrassl" or plugin ID)
    • getName

      @Nonnull String getName()
      Get the name portion of the channel ID.
      Returns:
      the channel name within the namespace
    • isSystemChannel

      default boolean isSystemChannel()
      Check if this is a system channel (numdrassl namespace).
      Returns:
      true if this is a predefined system channel