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.Logger
Returns the logger of the concrete class.void
handleInboundFailure
(Context ctx, Throwable cause) Default implementation that simply propagates the failure through the pipeline.void
handleInboundMessage
(Context ctx, InboundMessage msg) Default implementation that simply propagates the message through the pipeline.void
handleUserEvent
(Context ctx, Object evt) Default implementation that simply propagates the user event through the pipeline.void
Default implementation that simply propagates the connection active event through the pipeline.void
Default implementation that simply propagates the connection inactive event through the pipeline.void
onHandlerAdded
(Context ctx) Default implementation that logs the handler addition event.void
onHandlerRemoved
(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:
handleInboundFailure
in interfaceInboundHandler
- Parameters:
ctx
- theContext
this handler is bound tocause
- theThrowable
describing the failure- Since:
- 1.0.0
-
handleInboundMessage
Default implementation that simply propagates the message through the pipeline.- Specified by:
handleInboundMessage
in interfaceInboundHandler
- Parameters:
ctx
- theContext
this handler is bound tomsg
- theInboundMessage
being processed- Since:
- 1.0.0
-
handleUserEvent
Default implementation that simply propagates the user event through the pipeline.- Specified by:
handleUserEvent
in interfaceHandler
- Parameters:
ctx
- theContext
this 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:
onConnectionActive
in interfaceHandler
- Parameters:
ctx
- theContext
this handler is bound to- Since:
- 1.0.0
-
onConnectionInactive
Default implementation that simply propagates the connection inactive event through the pipeline.- Specified by:
onConnectionInactive
in interfaceHandler
- Parameters:
ctx
- theContext
this handler is bound to- Since:
- 1.0.0
-
onHandlerAdded
Default implementation that logs the handler addition event.- Specified by:
onHandlerAdded
in interfaceHandler
- Parameters:
ctx
- theContext
this handler is bound to- Since:
- 1.0.0
-
onHandlerRemoved
Default implementation that logs the handler removal event.- Specified by:
onHandlerRemoved
in interfaceHandler
- Parameters:
ctx
- theContext
this 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
-