Class DefaultAddressedEnvelope<M, A extends java.net.SocketAddress>
java.lang.Object
io.netty.channel.DefaultAddressedEnvelope<M,A>
- Type Parameters:
M- the type of the wrapped messageA- the type of the recipient address
- All Implemented Interfaces:
AddressedEnvelope<M,A>, ReferenceCounted
- Direct Known Subclasses:
DatagramPacket, DomainDatagramPacket
public class DefaultAddressedEnvelope<M, A extends java.net.SocketAddress>
extends java.lang.Object
implements AddressedEnvelope<M,A>
The default
AddressedEnvelope implementation.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultAddressedEnvelope(M message, A recipient) Creates a new instance with the specifiedmessageandrecipientaddress.DefaultAddressedEnvelope(M message, A recipient, A sender) Creates a new instance with the specifiedmessage,recipientaddress, andsenderaddress. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the message wrapped by this envelope message.Returns the address of the recipient of this message.intrefCnt()Returns the reference count of this object.booleanrelease()Decreases the reference count by1and deallocates this object if the reference count reaches at0.booleanrelease(int decrement) Decreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.retain()Increases the reference count by1.retain(int increment) Increases the reference count by the specifiedincrement.sender()Returns the address of the sender of this message.java.lang.StringtoString()touch()Records the current access location of this object for debugging purposes.touch(java.lang.Object hint) Records the current access location of this object with an additional arbitrary information for debugging purposes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
message
-
sender
-
recipient
-
-
Constructor Details
-
DefaultAddressedEnvelope
-
DefaultAddressedEnvelope
-
-
Method Details
-
content
Description copied from interface:AddressedEnvelopeReturns the message wrapped by this envelope message.- Specified by:
contentin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>
-
sender
Description copied from interface:AddressedEnvelopeReturns the address of the sender of this message.- Specified by:
senderin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>
-
recipient
Description copied from interface:AddressedEnvelopeReturns the address of the recipient of this message.- Specified by:
recipientin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>
-
refCnt
public int refCnt()Description copied from interface:ReferenceCountedReturns the reference count of this object. If0, it means this object has been deallocated.- Specified by:
refCntin interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by1.- Specified by:
retainin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>- Specified by:
retainin interfaceReferenceCounted
-
retain
Description copied from interface:ReferenceCountedIncreases the reference count by the specifiedincrement.- Specified by:
retainin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>- Specified by:
retainin interfaceReferenceCounted
-
release
public boolean release()Description copied from interface:ReferenceCountedDecreases the reference count by1and deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
release
public boolean release(int decrement) Description copied from interface:ReferenceCountedDecreases the reference count by the specifieddecrementand deallocates this object if the reference count reaches at0.- Specified by:
releasein interfaceReferenceCounted- Returns:
trueif and only if the reference count became0and this object has been deallocated
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector. This method is a shortcut totouch(null).- Specified by:
touchin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>- Specified by:
touchin interfaceReferenceCounted
-
touch
Description copied from interface:ReferenceCountedRecords the current access location of this object with an additional arbitrary information for debugging purposes. If this object is determined to be leaked, the information recorded by this operation will be provided to you viaResourceLeakDetector.- Specified by:
touchin interfaceAddressedEnvelope<M, A extends java.net.SocketAddress>- Specified by:
touchin interfaceReferenceCounted
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-