Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion Threading Policies
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Stefan Weber  
View profile  
 More options Nov 12 2009, 2:09 pm
From: Stefan Weber <stefan.we...@gmail.com>
Date: Thu, 12 Nov 2009 20:09:08 +0100
Local: Thurs, Nov 12 2009 2:09 pm
Subject: Re: Threading Policies

On Thu, Nov 12, 2009 at 3:14 PM, Sergio Bossa <sergio.bo...@gmail.com>wrote:

> So, you'd like to implement some kind of custom routing logic: that
> is, rather than routing on the message type, you may want to route on
> some kind of message property, is that correct?

Correct :)

> If so, the correct way to solve this would be IMO to enhance the
> annotation processing, i.e. by adding some kind of predicate to test
> on received messages, something like:

> @OnMessage(type = Message.class, predicate = FooPredicate.class)
> void handleFooMessage(Message msg) {...} // handles messages of type foo

> public class FooPredicate implements Predicate<Message> {

>    public boolean accept(Message msg) { ... }
> }

> What do you think?

This looks very nice! Much cleaner than the solution I tried to described!

Cheers,

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.