You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within a @managedservice, I have multiple methods annotated with @message, all but one of them having just decoders, i.e. for incoming messages. The only messages the server is sending is "update-type" messages to all connected clients (one per client) in an "update" method. Please see the example code below for details.
What happens is that in org.atmosphere.config.managed.ManagedAtmosphereHandler:178 a suitable encoder for "Update" is looked for:
[...]
} else {
Objectmsg = event.getMessage();
Objecto;
// No method matched. Give a last chance by trying to decode the proxiedInstance.// This makes application development more simpler.// Chaining of encoder is not supported.// TODO: This could be problematic with String + methodfor (MethodInfom : onRuntimeMethod) {
o = Invoker.encode(encoders.get(m.method), msg);
if (o != null) {
event.setMessage(o);
break;
}
}
[...]
However, if - for whatever reason - the for-MethodInfo loop here comes across one of the "decoder-only" @Message-annotated methods first, it will just encode the class with the default "toString" method (which is useless, obviously) rather than the (Jackson) UpdateEncoder I'd want to use. What fixes it is adding the UpdateEncoder to all "decoder-only" methods
Within a @managedservice, I have multiple methods annotated with @message, all but one of them having just decoders, i.e. for incoming messages. The only messages the server is sending is "update-type" messages to all connected clients (one per client) in an "update" method. Please see the example code below for details.
What happens is that in org.atmosphere.config.managed.ManagedAtmosphereHandler:178 a suitable encoder for "Update" is looked for:
However, if - for whatever reason - the for-MethodInfo loop here comes across one of the "decoder-only" @Message-annotated methods first, it will just encode the class with the default "toString" method (which is useless, obviously) rather than the (Jackson) UpdateEncoder I'd want to use. What fixes it is adding the UpdateEncoder to all "decoder-only" methods
Sample code:
Google groups thread:
https://groups.google.com/forum/?hl=en#!topic/atmosphere-framework/thG8zItZXvE
The text was updated successfully, but these errors were encountered: