Package com.lucimber.dbus.connection
Class AbstractInboundHandler
java.lang.Object
com.lucimber.dbus.connection.AbstractInboundHandler
- All Implemented Interfaces:
Handler,InboundHandler
- Direct Known Subclasses:
StandardInterfaceHandler
A skeletal implementation of the
InboundHandler interface.
This abstract base class provides default (no-op) implementations of all lifecycle methods except for the core inbound handling methods, which must be implemented by subclasses.
Extend this class to simplify the creation of handlers that only need to process inbound messages and optionally handle connection or pipeline events.
The default implementations of all methods simply propagate events through the pipeline without any additional processing, making this class suitable as a base for handlers that only need to override specific methods.
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.slf4j.LoggerReturns the logger of the concrete class.voidhandleInboundFailure(Context ctx, Throwable cause) Default implementation that simply propagates the failure through the pipeline.voidhandleInboundMessage(Context ctx, InboundMessage msg) Default implementation that simply propagates the message through the pipeline.voidhandleUserEvent(Context ctx, Object evt) Default implementation that simply propagates the user event through the pipeline.voidDefault implementation that simply propagates the connection active event through the pipeline.voidDefault implementation that simply propagates the connection inactive event through the pipeline.voidonHandlerAdded(Context ctx) Default implementation that logs the handler addition event.voidonHandlerRemoved(Context ctx) Default implementation that logs the handler removal event.
-
Constructor Details
-
AbstractInboundHandler
public AbstractInboundHandler()
-
-
Method Details
-
handleInboundFailure
Default implementation that simply propagates the failure through the pipeline.- Specified by:
handleInboundFailurein interfaceInboundHandler- Parameters:
ctx- theContextthis handler is bound tocause- theThrowabledescribing the failure- Since:
- 1.0.0
-
handleInboundMessage
Default implementation that simply propagates the message through the pipeline.- Specified by:
handleInboundMessagein interfaceInboundHandler- Parameters:
ctx- theContextthis handler is bound tomsg- theInboundMessagebeing processed- Since:
- 1.0.0
-
handleUserEvent
Default implementation that simply propagates the user event through the pipeline.- Specified by:
handleUserEventin interfaceHandler- Parameters:
ctx- theContextthis handler is bound toevt- the user-defined event object- Since:
- 1.0.0
-
onConnectionActive
Default implementation that simply propagates the connection active event through the pipeline.- Specified by:
onConnectionActivein interfaceHandler- Parameters:
ctx- theContextthis handler is bound to- Since:
- 1.0.0
-
onConnectionInactive
Default implementation that simply propagates the connection inactive event through the pipeline.- Specified by:
onConnectionInactivein interfaceHandler- Parameters:
ctx- theContextthis handler is bound to- Since:
- 1.0.0
-
onHandlerAdded
Default implementation that logs the handler addition event.- Specified by:
onHandlerAddedin interfaceHandler- Parameters:
ctx- theContextthis handler is bound to- Since:
- 1.0.0
-
onHandlerRemoved
Default implementation that logs the handler removal event.- Specified by:
onHandlerRemovedin interfaceHandler- Parameters:
ctx- theContextthis handler is bound to- Since:
- 1.0.0
-
getLogger
protected abstract org.slf4j.Logger getLogger()Returns the logger of the concrete class.- Returns:
- the logger instance for this handler
- Since:
- 1.0.0
-