public class AMF3Protocol extends AbstractNettyProtocol
PlayerSession
's pipeline. The major handlers
involved are AMF3ToEventSourceDecoder
and
EventSourceToAMF3Encoder
.Modifier and Type | Field and Description |
---|---|
private AMF3ToEventSourceDecoder |
amf3ToEventSourceDecoder
This decoder will do the actual serialization to java object.
|
private EventDecoder |
eventDecoder
After the frame decoder retrieves the bytes from the incoming stream,
this decoder will convert it to an
Event with the opcode set as
the first byte read from the buffer. |
private EventEncoder |
eventEncoder
This encoder will take the event parsed by the java object to AMF3
encoder and create a single wrapped
ChannelBuffer with the opcode
as header and amf3 bytes as body. |
private EventSourceToAMF3Encoder |
eventSourceToAMF3Encoder
Once the game handler is done with its operations, it writes back the
java object to the client.
|
private org.jboss.netty.handler.codec.frame.LengthFieldPrepender |
lengthFieldPrepender
Utility handler provided by netty to add the length of the outgoing
message to the message as a header.
|
IDLE_CHECK_HANDLER, IDLE_STATE_CHECK_HANDLER
Constructor and Description |
---|
AMF3Protocol() |
Modifier and Type | Method and Description |
---|---|
void |
applyProtocol(PlayerSession playerSession)
The main method of this interface.
|
AMF3ToEventSourceDecoder |
getAmf3ToEventSourceDecoder() |
EventDecoder |
getEventDecoder() |
EventEncoder |
getEventEncoder() |
EventSourceToAMF3Encoder |
getEventSourceToAMF3Encoder() |
org.jboss.netty.handler.codec.frame.LengthFieldPrepender |
getLengthFieldPrepender() |
void |
setAmf3ToEventSourceDecoder(AMF3ToEventSourceDecoder amf3ToEventSourceDecoder) |
void |
setEventDecoder(EventDecoder eventDecoder) |
void |
setEventEncoder(EventEncoder eventEncoder) |
void |
setEventSourceToAMF3Encoder(EventSourceToAMF3Encoder eventToAMF3Encoder) |
void |
setLengthFieldPrepender(org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender) |
applyProtocol, createLengthBasedFrameDecoder, getProtocolName
private EventDecoder eventDecoder
Event
with the opcode set as
the first byte read from the buffer. And the source object of the event
created will have the rest of the ChannelBuffer
.private AMF3ToEventSourceDecoder amf3ToEventSourceDecoder
private EventSourceToAMF3Encoder eventSourceToAMF3Encoder
private EventEncoder eventEncoder
ChannelBuffer
with the opcode
as header and amf3 bytes as body.private org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender
public void applyProtocol(PlayerSession playerSession)
Protocol
LoginHandler
or whichever previous
handler was handling the message has cleared up the
ChannelPipeline
object.playerSession
- The user session for which the protocol handlers need to be
set.public EventSourceToAMF3Encoder getEventSourceToAMF3Encoder()
public org.jboss.netty.handler.codec.frame.LengthFieldPrepender getLengthFieldPrepender()
public EventDecoder getEventDecoder()
public EventEncoder getEventEncoder()
public AMF3ToEventSourceDecoder getAmf3ToEventSourceDecoder()
public void setEventDecoder(EventDecoder eventDecoder)
public void setEventSourceToAMF3Encoder(EventSourceToAMF3Encoder eventToAMF3Encoder)
public void setEventEncoder(EventEncoder eventEncoder)
public void setLengthFieldPrepender(org.jboss.netty.handler.codec.frame.LengthFieldPrepender lengthFieldPrepender)
public void setAmf3ToEventSourceDecoder(AMF3ToEventSourceDecoder amf3ToEventSourceDecoder)
Copyright © 2013. All Rights Reserved.