Hi folks,
I am developing a session pool for an HTTP backend which is requested with the
fabulous HttpClient.
The session object is this:
public class RawSession {
private CookieStore cookieStore;
private String logId;
private MutableInt requestId;
private String clientId;
private String serverId;
}
There won't be any setters but as you see, the cookie store and mutable int
might change.
Additionally, I did not implement any custom equals and hashCode methods.
I have searched the docs and the found and did not find any clear answer which
says
that pooled objects have to be immutable. Though, I have found POOL-283 and
POOL-284 which
led me to the conclusion that this is a problem because the objects are stored
in a map
which relies on equals and hashCode.
Does this ultimately mean that I have to override equals and hashCode and
provide some internal,
immutable value something like a UUID? Alternatively, I could retrieve the
JSESSIONID from the
cookie store and use this as a unique value.
Thanks,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]