users@glassfish.java.net

RE: Re: ExecutorService in Glassfish ?

From: Markus Karg <karg_at_quipsy.de>
Date: Mon, 23 Nov 2009 08:28:51 +0100

To extend the idea, why not investing some more time writing an Open Source "Twitter ResourceAdapter" or "Skype ResourceAdaptater"? I think there will be more people than you rating that a useful component. If you need a template on how to write ResourceAdpaters, check my projects "FileRA" and "MailRA" on SourceForge: While the first one is using outbounds (which is what you need), the second one is using WorkManagers (AFAIK -- it's too long ago since I wrote it). :-)

> -----Original Message-----
> From: Sivakumar.Thyagarajan_at_Sun.COM
> [mailto:Sivakumar.Thyagarajan_at_Sun.COM]
> Sent: Montag, 23. November 2009 05:45
> To: users_at_glassfish.dev.java.net
> Subject: Re: ExecutorService in Glassfish ?
>
> Hi
>
> Felipe Gaúcho wrote:
> > I have this application that should notify several external services
> > (twitter, etc..) .. and I am thinking of using Future tasks for
> that..
> >
> > what means:
> >
> > myCode() {
> > // do business here
> > // push future threads in a pool
> > // respond to the client while the future tasks run out there...
> > }
> >
> > I don't care about the results of the future tasks, if a notification
> > to twitter fails for example it doesn't matter for my business....
> >
> > So, I was wondering if Glassfish gives me such a thread pool ..
>
> You could consider using Connectors WorkManager. See the discussion at
> Work Management Contract at
> http://java.sun.com/javaee/5/docs/tutorial/doc/bnckb.html
>
> The WorkManager does not give a rich interface such as Future but is
> backed by a Thread pool. You would then write a simple resource adapter
> , use a Work instance to send your notifications and submit such Work
> instances to the WorkManager for execution.
>
> Thanks
> --Siva.
>
> > (instead of my application to create it all the time....)
> >
> > ------------------------------------------
> > Felipe Gaúcho
> > 10+ Java Programmer
> > CEJUG Senior Adviser
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> > For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net



____________
Virus checked by G DATA AntiVirus
Version: AVB 19.525 dated 27.10.2009
Virus news: www.antiviruslab.com