public class DefaultConnectionStateHandler extends java.lang.Object implements ConnectionStateHandler
Title: Service Event Fabric Core
Description: Defines a default implementation of the ConnectionStateHandler
.
Copyright: Copyright (c) 2011
Company: StreamScape Technologies
Constructor and Description |
---|
DefaultConnectionStateHandler() |
DefaultConnectionStateHandler(PacketHandler packetHandler) |
Modifier and Type | Method and Description |
---|---|
PacketHandler |
getPacketHandler()
Returns a packet handler that processes incoming packets received by the connection.
|
void |
onClose(Connection connection,
boolean isNormal)
This method is invoked before the specified connection will be closed.
|
void |
onError(Connection connection,
FabricException exception)
This method will be invoked if the specified error occurs during a work of the specified connection.
|
void |
onOpen(Connection connection,
boolean isOutgoing)
This method will be immediately invoked after the specified connection is opened.
|
public DefaultConnectionStateHandler()
public DefaultConnectionStateHandler(PacketHandler packetHandler)
public void onOpen(Connection connection, boolean isOutgoing) throws FabricException
ConnectionStateHandler
onOpen
in interface ConnectionStateHandler
connection
- the connection associated with the handler.isOutgoing
- the flag indicating if the connection is outgoing.FabricException
- if some error occurs.public void onClose(Connection connection, boolean isNormal)
ConnectionStateHandler
onClose
in interface ConnectionStateHandler
connection
- the connection associated with the handler.isNormal
- the flag indicating if the closing is normal.public void onError(Connection connection, FabricException exception)
ConnectionStateHandler
onError
in interface ConnectionStateHandler
connection
- the connection associated with the handler.exception
- the occurred error.public PacketHandler getPacketHandler()
ConnectionStateHandler
getPacketHandler
in interface ConnectionStateHandler
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.