Package com.lucimber.dbus.connection
Interface Handler
- All Known Subinterfaces:
InboundHandler
,OutboundHandler
- All Known Implementing Classes:
AbstractDuplexHandler
,AbstractInboundHandler
,AbstractOutboundHandler
,ConnectionHealthHandler
,ConnectionReconnectHandler
,StandardInterfaceHandler
public interface Handler
A handler that can be attached to a
Pipeline
to intercept and respond to connection state
changes and user-defined events.
Implementations of this interface are notified about lifecycle events and can perform processing based on their role in the pipeline.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleUserEvent
(Context ctx, Object evt) Invoked when a user-defined event is propagated through the pipeline.void
Invoked when the connection associated with this context becomes active.void
Invoked when the connection associated with this context becomes inactive.void
onHandlerAdded
(Context ctx) Invoked when this handler is added to the pipeline.void
onHandlerRemoved
(Context ctx) Invoked just before this handler is removed from the pipeline.
-
Method Details
-
onConnectionActive
Invoked when the connection associated with this context becomes active.- Parameters:
ctx
- theContext
this handler is bound to.
-
onConnectionInactive
Invoked when the connection associated with this context becomes inactive.- Parameters:
ctx
- theContext
this handler is bound to.
-
onHandlerAdded
Invoked when this handler is added to the pipeline.This is typically the first lifecycle method called for a handler.
- Parameters:
ctx
- theContext
this handler is bound to.
-
onHandlerRemoved
Invoked just before this handler is removed from the pipeline.This allows the handler to perform any necessary cleanup.
- Parameters:
ctx
- theContext
this handler is bound to.
-
handleUserEvent
Invoked when a user-defined event is propagated through the pipeline.Handlers can choose to react to or forward the event, depending on their logic.
- Parameters:
ctx
- theContext
this handler is bound to.evt
- the user-defined event to handle.
-