netty5/common/src/main/java/io/netty/util/Attribute.java
Trustin Lee 22a815eaf8 Revamp channel handler API
- Merged LifeCycleAwareChannelHandler into ChannelHandler
- Replaced ChannelUpstreamHandler and ChannelDownstreamHandler with
  ChannelReader and ChannelWriter
  - These two new interfaces are much more type-safe than its ancestor.
- Simplified channel state model as described in #68
- Handler creates send/receive buffer.
  - Previously, Netty created them, but it led to more memory copies and
    inflexibility.  I'm going to allow a handler to create a bounded
    queue for example.
  - It currently uses Queue<T> but I'll define a new interface and make
    ChannelBuffer implement it (e.g. Queue<Byte>)
- Introduced AttributeMap which replaces attachments in Channel and
  ChannelHandlerContext and ChannelLocal
2012-04-12 17:39:01 +09:00

11 lines
218 B
Java

package io.netty.util;
public interface Attribute<T> {
T get();
void set(T value);
T getAndSet(T value);
T setIfAbsent(T value);
boolean compareAndSet(T oldValue, T newValue);
void remove();
}