java.lang.Object
org.firebirdsql.gds.ng.AbstractEventHandle
org.firebirdsql.gds.ng.wire.WireEventHandle
- All Implemented Interfaces:
EventHandle
,AsynchronousChannelListener
public final class WireEventHandle
extends AbstractEventHandle
implements AsynchronousChannelListener
Event handle for the wire protocol.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firebirdsql.gds.ng.wire.AsynchronousChannelListener
AsynchronousChannelListener.Event
-
Constructor Summary
ConstructorsConstructorDescriptionWireEventHandle
(String eventName, EventHandler eventHandler, Encoding encoding) -
Method Summary
Modifier and TypeMethodDescriptionint
Generates a new local id for this event.void
void
channelClosing
(FbWireAsynchronousChannel channel) Signals the closing of an asynchronous channel.void
eventReceived
(FbWireAsynchronousChannel channel, AsynchronousChannelListener.Event event) Signals that an event has been received.int
Get the internal event id number for this handleint
void
setEventId
(int eventId) byte[]
toString()
Methods inherited from class org.firebirdsql.gds.ng.AbstractEventHandle
getEventCount, getEventName, onEventOccurred, setEventCount
-
Constructor Details
-
WireEventHandle
-
-
Method Details
-
calculateCount
public void calculateCount() -
setEventId
public void setEventId(int eventId) - Parameters:
eventId
- The server side id of this event
-
getEventId
public int getEventId()Description copied from interface:EventHandle
Get the internal event id number for this handle- Specified by:
getEventId
in interfaceEventHandle
- Returns:
- The internal event id
-
assignNewLocalId
public int assignNewLocalId()Generates a new local id for this event. -
getLocalId
public int getLocalId()- Returns:
- The current local id of this event.
-
toByteArray
- Throws:
IOException
-
channelClosing
Description copied from interface:AsynchronousChannelListener
Signals the closing of an asynchronous channel.Fired before the channel is actually closed.
- Specified by:
channelClosing
in interfaceAsynchronousChannelListener
- Parameters:
channel
- channel that is being closed
-
eventReceived
public void eventReceived(FbWireAsynchronousChannel channel, AsynchronousChannelListener.Event event) Description copied from interface:AsynchronousChannelListener
Signals that an event has been received.Implementations should take care to only perform short processing on the current thread. If longer or complicated processing is necessary, please offload it to another thread or executor.
- Specified by:
eventReceived
in interfaceAsynchronousChannelListener
- Parameters:
channel
- channel that received the eventevent
- event received
-
toString
-