Interface OnMessageListener<T>

Type Parameters:
T - the type of object stored in the ActiveObjectContext
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface OnMessageListener<T>
Functional interface that represents a listener for messages.

The implementing class should define the behavior of how to handle a message within the context.

  • Method Details

    • onObjectMessage

      @Nullable Object onObjectMessage(Object message, ActiveObjectContext<T> context)
      This method is called when an object message is received.

      The implementing class should define how to handle the message based on the provided context.

      Parameters:
      message - the message that was received, can be any type of Object
      context - the ActiveObjectContext in which the message was received
      Returns:
      an object representing the result or response to the message, or null if there is no specific response required