Package org.firebirdsql.gds.ng.wire
Class WireEventHandle
- 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
Constructors Constructor Description WireEventHandle(java.lang.String eventName, EventHandler eventHandler, Encoding encoding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intassignNewLocalId()Generates a new local id for this event.voidcalculateCount()voidchannelClosing(FbWireAsynchronousChannel channel)Signals the closing of an asynchronous channel.voideventReceived(FbWireAsynchronousChannel channel, AsynchronousChannelListener.Event event)Signals that an event has been received.intgetEventId()Get the internal event id number for this handleintgetLocalId()voidsetEventId(int eventId)byte[]toByteArray()java.lang.StringtoString()-
Methods inherited from class org.firebirdsql.gds.ng.AbstractEventHandle
getEventCount, getEventName, onEventOccurred, setEventCount
-
-
-
-
Constructor Detail
-
WireEventHandle
public WireEventHandle(java.lang.String eventName, EventHandler eventHandler, Encoding encoding)
-
-
Method Detail
-
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:EventHandleGet the internal event id number for this handle- Specified by:
getEventIdin 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
public byte[] toByteArray() throws java.io.IOException- Throws:
java.io.IOException
-
channelClosing
public void channelClosing(FbWireAsynchronousChannel channel)
Description copied from interface:AsynchronousChannelListenerSignals the closing of an asynchronous channel.Fired before the channel is actually closed.
- Specified by:
channelClosingin interfaceAsynchronousChannelListener- Parameters:
channel- The channel that is being closed
-
eventReceived
public void eventReceived(FbWireAsynchronousChannel channel, AsynchronousChannelListener.Event event)
Description copied from interface:AsynchronousChannelListenerSignals 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:
eventReceivedin interfaceAsynchronousChannelListener- Parameters:
channel- The channel that received the eventevent- The event received
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-