Bongjae Chang
13 years ago
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
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