|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.filter.codec.SynchronizedProtocolEncoder
public class SynchronizedProtocolEncoder
A ProtocolEncoder
implementation which decorates an existing encoder
to be thread-safe. Please be careful if you're going to use this decorator
because it can be a root of performance degradation in a multi-thread
environment. Please use this decorator only when you need to synchronize
on a per-encoder basis instead of on a per-session basis, which is not
common.
Constructor Summary | |
---|---|
SynchronizedProtocolEncoder(ProtocolEncoder encoder)
Creates a new instance which decorates the specified encoder. |
Method Summary | |
---|---|
void |
dispose(IoSession session)
Releases all resources related with this encoder. |
void |
encode(IoSession session,
java.lang.Object message,
ProtocolEncoderOutput out)
Encodes higher-level message objects into binary or protocol-specific data. |
ProtocolEncoder |
getEncoder()
Returns the encoder this encoder is decorating. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SynchronizedProtocolEncoder(ProtocolEncoder encoder)
Method Detail |
---|
public ProtocolEncoder getEncoder()
public void encode(IoSession session, java.lang.Object message, ProtocolEncoderOutput out) throws java.lang.Exception
ProtocolEncoder
ProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded ByteBuffer
s into
ProtocolEncoderOutput
.
encode
in interface ProtocolEncoder
java.lang.Exception
- if the message violated protocol specificationpublic void dispose(IoSession session) throws java.lang.Exception
ProtocolEncoder
dispose
in interface ProtocolEncoder
java.lang.Exception
- if failed to dispose all resources
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |