While reviewing the cafe sample code, I wanted to see how I could save 2 lines of XML config by using annotations on the Barista class to do things like configuring the concurrency policy and parameterizing the handlers.
The API doesn't support this, but I first thought something like the following would be ok
...and then I threw this style out as it makes the endpoint almost completely non-resusable...appears locked to a specific concurrency strategy and channel mapping at compile time.Code:// INVALID CODE @MessageEndpoint @Concurrency(core="25", max="50") public class Barista { ... @Handler(input="coldDrinks") public void prepareColdDrink(Drink drink) {...} @Handler(input="hotDrinks") public void prepareHotDrink(Drink drink) {...} ... }
Not being that familiar with the API yet, any usage suggestions on annotations and XML config? I'm all for minimizing the XML config
Jon



Reply With Quote