I was thinking because of how the Services implementation & instantiation is managed by tapestry. How the service is injected instead of manually created.
Thanks for the hint, I will look at those files source code. On Mon, Jun 19, 2017 at 7:22 PM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote: > On Sun, Jun 18, 2017 at 12:52 PM, abangkis <abang...@gmail.com> wrote: > > > Lets say I have a hashtag entity that i stored in the database and > managed > > by HashtagDAO (a tapestry service). And then i have a > TwitterParserService > > that check if a tweet contain a hashtag that i saved in the database. The > > problem, if someone add or changed the hashtag in the database i want the > > TwitterParserService to immediately know about the change and check the > > tweet using the new hashtags. > > > > In j2se it will be a straight forward pub-sub/observer pattern. Just > create > > an interface for the listener, let the TwitterParserService implement it > > and set as the default listener, and invoke it from HashtagDAO. But i > don't > > think it would work with tapestry services class. > > > > Why wouldn't it work? Tapestry itself uses this: LinkCreationHub, > RegistryStartup, InvalidationEventHub, RegistryShutdownHub, > UpdateListenerHub, and that's just the ones I've found in a two-minute > search. It would all be synchrononous, though, and messaging services, as > far as I know, are asynchronous. > > -- > Thiago > -- http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/> twitter : @mreunionlabs @abangkis page : https://plus.google.com/104168782385184990771