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 TypeMethodDescriptionvoidhandleUserEvent(Context ctx, Object evt) Invoked when a user-defined event is propagated through the pipeline.voidInvoked when the connection associated with this context becomes active.voidInvoked when the connection associated with this context becomes inactive.voidonHandlerAdded(Context ctx) Invoked when this handler is added to the pipeline.voidonHandlerRemoved(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- theContextthis handler is bound to.
-
onConnectionInactive
Invoked when the connection associated with this context becomes inactive.- Parameters:
ctx- theContextthis 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- theContextthis 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- theContextthis 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- theContextthis handler is bound to.evt- the user-defined event to handle.
-