Package org.apache.mina.common
Class TrafficMask
java.lang.Object
org.apache.mina.common.TrafficMask
A type-safe mask that is used to control the traffic of
IoSession
with IoSession.setTrafficMask(TrafficMask)
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TrafficMask
This mask resumes both reads and writes if any of them were suspended.static final TrafficMask
This mask suspends both reads and writes.static final TrafficMask
This mask suspends writes, and resumes reads if reads were suspended.static final TrafficMask
This mask suspends reads, and resumes writes if writes were suspended. -
Method Summary
Modifier and TypeMethodDescriptionand
(TrafficMask mask) Peforms an AND operation on this mask with the specified mask and returns the result.static TrafficMask
getInstance
(int interestOps) Returns an appropriateTrafficMask
instance from the specified interestOps.int
Returns an interestOps ofSelectionKey
for this mask.getName()
Returns the name of this mask.boolean
Returns true if this mask allows a read operation.boolean
Returns true if this mask allows a write operation.not()
Returns a negated mask of this one.or
(TrafficMask mask) Peforms an OR operation on this mask with the specified mask and returns the result.toString()
xor
(TrafficMask mask) Peforms an XOR operation on this mask with the specified mask and returns the result.
-
Field Details
-
NONE
This mask suspends both reads and writes. -
READ
This mask suspends writes, and resumes reads if reads were suspended. -
WRITE
This mask suspends reads, and resumes writes if writes were suspended. -
ALL
This mask resumes both reads and writes if any of them were suspended.
-
-
Method Details
-
getInstance
Returns an appropriateTrafficMask
instance from the specified interestOps.- See Also:
-
getName
Returns the name of this mask. -
isReadable
public boolean isReadable()Returns true if this mask allows a read operation. -
isWritable
public boolean isWritable()Returns true if this mask allows a write operation. -
getInterestOps
public int getInterestOps()Returns an interestOps ofSelectionKey
for this mask. -
and
Peforms an AND operation on this mask with the specified mask and returns the result. -
or
Peforms an OR operation on this mask with the specified mask and returns the result. -
not
Returns a negated mask of this one. -
xor
Peforms an XOR operation on this mask with the specified mask and returns the result. -
toString
-