Interface ConnectionContext

    • Method Detail

      • init

        Registration init​(ActivationHandler activationHandler,
                          Executor executor)
        Initializes the connection context with a ActivationHandler and an Executor.

        The method Consumer.accept(Object) from the provided ActivationHandler should be called with an ActionDispatcher when this ConnectionContext is activated. When this ConnectionContext is deactivated, it should call Consumer.accept(Object) with a null parameter.

        The ActionDispatcher should ensure synchronization within the context of this ConnectionContext.

        Parameters:
        activationHandler - the handler for activation changes
        executor - executor that should be used by the handler to execute background tasks. Not null
        Returns:
        the registration for any logic that needs to be cleaned up if the connection is closed permanently, or null if there is nothing to clean up