Discussion:
About setting attribute
Bongjae Chang
13 years ago
Permalink
Hi,

When I set an attribute to NIOConnection, I had a problem.

Here is example.

When a connection established, I tried to attach an attribute to the
connection like this.
---
future = connectorHandler.connect(Š);
connection = future.get();
AttributeHolder attributeHolder = Connection.getAttributes();
attributeHolder.setAttribute("first", "sample1"); -----(1)
---

In my filter class, another attribute was defined like this.
---
private final Attribute anotherAttribute =
Grizzly.DEFAULT_ATTRIBUTE_BUILDER.createAttribute("another");
---

When I called the "anotherAttribute.get(connection)" first, the first
attribute(1) returned.

When I reviewed sources about attributes, I found NIOConnection didn't have
Grizzly.DEFAULT_ATTRIBUTE_BUILDER but
AttributeBuilder.DEFAULT_ATTRIBUTE_BUILDER.
So, attributes could get twisted in the same NIOConnection.

I would like to know if I used a wrong way for setting attribute associated
with connection.

Thanks.

Regards,
Bongjae Chang
Oleksiy Stashok
13 years ago
Permalink
Hi Bongjae,

good catch!

These 2 default builders should be the same.
Can you pls. file issue and fix it? :)

Thanks.

WBR,
Alexey.
...
Bongjae Chang
13 years ago
Permalink
Hi Alexey,

I fixed it.

Thanks!

Regards,
Bongjae Chang
...
Loading...