Top Description Fields Constructors Methods
io.netty.channel

public Class DefaultAddressedEnvelope<M, A extends java.net.SocketAddress>

extends Object
implements AddressedEnvelope<M, A extends SocketAddress>
Class Inheritance
All Implemented Interfaces
io.netty.channel.AddressedEnvelope, io.netty.util.ReferenceCounted
Known Direct Subclasses
io.netty.channel.socket.DatagramPacket
Type Parameters
<M>
the type of the wrapped message
<A>
the type of the recipient address
Imports
io.netty.util.ReferenceCountUtil, .ReferenceCounted, io.netty.util.internal.ObjectUtil, .StringUtil, java.net.SocketAddress

The default AddressedEnvelope implementation.

Field Summary

Modifier and TypeField and Description
private final M
private final A
private final A

Constructor Summary

AccessConstructor and Description
public
DefaultAddressedEnvelope(M message, A recipient, A sender)

Creates a new instance with the specified message, recipient address, and sender address.

public
DefaultAddressedEnvelope(M message, A recipient)

Creates a new instance with the specified message and recipient address.

Method Summary

Modifier and TypeMethod and Description
public M
content()

Implements io.netty.channel.AddressedEnvelope.content.

Returns the message wrapped by this envelope message.
public A
recipient()

Implements io.netty.channel.AddressedEnvelope.recipient.

Returns the address of the recipient of this message.
public int
refCnt()

Implements io.netty.util.ReferenceCounted.refCnt.

Returns the reference count of this object.
public boolean
release()

Implements io.netty.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.
public boolean
release(int decrement)

Implements io.netty.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.
public AddressedEnvelope<M, A>
retain()

Implements io.netty.channel.AddressedEnvelope.retain.

Increases the reference count by 1.
public AddressedEnvelope<M, A>
retain(int increment)

Implements io.netty.channel.AddressedEnvelope.retain.

Increases the reference count by the specified increment.
public A
sender()

Implements io.netty.channel.AddressedEnvelope.sender.

Returns the address of the sender of this message.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public AddressedEnvelope<M, A>
touch()

Implements io.netty.channel.AddressedEnvelope.touch.

Records the current access location of this object for debugging purposes.
public AddressedEnvelope<M, A>
touch(Object hint)

Implements io.netty.channel.AddressedEnvelope.touch.

Records the current access location of this object with an additional arbitrary information for debugging purposes.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

messageback to summary
private final M message
recipientback to summary
private final A recipient
senderback to summary
private final A sender

Constructor Detail

DefaultAddressedEnvelopeback to summary
public DefaultAddressedEnvelope(M message, A recipient, A sender)

Creates a new instance with the specified message, recipient address, and sender address.

DefaultAddressedEnvelopeback to summary
public DefaultAddressedEnvelope(M message, A recipient)

Creates a new instance with the specified message and recipient address. The sender address becomes null.

Method Detail

contentback to summary
public M content()

Implements io.netty.channel.AddressedEnvelope.content.

Doc from io.netty.channel.AddressedEnvelope.content.

Returns the message wrapped by this envelope message.

Annotations
@Override
recipientback to summary
public A recipient()

Implements io.netty.channel.AddressedEnvelope.recipient.

Doc from io.netty.channel.AddressedEnvelope.recipient.

Returns the address of the recipient of this message.

Annotations
@Override
refCntback to summary
public int refCnt()

Implements io.netty.util.ReferenceCounted.refCnt.

Doc from io.netty.util.ReferenceCounted.refCnt.

Returns the reference count of this object. If 0, it means this object has been deallocated.

Annotations
@Override
releaseback to summary
public boolean release()

Implements io.netty.util.ReferenceCounted.release.

Doc from io.netty.util.ReferenceCounted.release.

Decreases the reference count by 1 and deallocates this object if the reference count reaches at 0.

Returns:boolean

true if and only if the reference count became 0 and this object has been deallocated

Annotations
@Override
releaseback to summary
public boolean release(int decrement)

Implements io.netty.util.ReferenceCounted.release.

Doc from io.netty.util.ReferenceCounted.release.

Decreases the reference count by the specified decrement and deallocates this object if the reference count reaches at 0.

Returns:boolean

true if and only if the reference count became 0 and this object has been deallocated

Annotations
@Override
retainback to summary
public AddressedEnvelope<M, A> retain()

Implements io.netty.channel.AddressedEnvelope.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by 1.

Annotations
@Override
retainback to summary
public AddressedEnvelope<M, A> retain(int increment)

Implements io.netty.channel.AddressedEnvelope.retain.

Doc from io.netty.util.ReferenceCounted.retain.

Increases the reference count by the specified increment.

Annotations
@Override
senderback to summary
public A sender()

Implements io.netty.channel.AddressedEnvelope.sender.

Doc from io.netty.channel.AddressedEnvelope.sender.

Returns the address of the sender of this message.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
touchback to summary
public AddressedEnvelope<M, A> touch()

Implements io.netty.channel.AddressedEnvelope.touch.

Doc from io.netty.util.ReferenceCounted.touch.

Records 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 via ResourceLeakDetector. This method is a shortcut to touch(null).

Annotations
@Override
touchback to summary
public AddressedEnvelope<M, A> touch(Object hint)

Implements io.netty.channel.AddressedEnvelope.touch.

Doc from io.netty.util.ReferenceCounted.touch.

Records 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 via ResourceLeakDetector.

Annotations
@Override