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 TrafficMaskThis mask resumes both reads and writes if any of them were suspended.static final TrafficMaskThis mask suspends both reads and writes.static final TrafficMaskThis mask suspends writes, and resumes reads if reads were suspended.static final TrafficMaskThis 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 TrafficMaskgetInstance(int interestOps) Returns an appropriateTrafficMaskinstance from the specified interestOps.intReturns an interestOps ofSelectionKeyfor this mask.getName()Returns the name of this mask.booleanReturns true if this mask allows a read operation.booleanReturns 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 appropriateTrafficMaskinstance 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 ofSelectionKeyfor 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
-