You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "steven.marcus" <st...@gmail.com> on 2007/08/26 01:34:43 UTC

bean method invocations on EDT

Is there any chance that support for bean method invocations on the event
dispatch thread could be added?

The URI might look something like:

bean:foo?methodName=addBar&EDT=true

Some way to tell @MessageDriven that it should dispatch on the EDT would be
really nice too...

I'm new to camel, but so far the refactoring of our project where we try out
using camel, spring, spring-javaconfig, and maven, is going very well. There
has been a large reduction and simplification of the code, and a new clarity
in the architecture... thanks!

Steven Marcus


-- 
View this message in context: http://www.nabble.com/bean-method-invocations-on-EDT-tf4329507s22882.html#a12330693
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: bean method invocations on EDT

Posted by James Strachan <ja...@gmail.com>.
On 8/26/07, steven.marcus <st...@gmail.com> wrote:
>
>
> James.Strachan wrote:
> >
> > Whats the event driven thread? Are you talking Swing/UI stuff?
> >
> > If so we could maybe have a component/endpoint to process messages in
> > the EDT. e.g. like the SEDA component, but the messages would be
> > processed in the EDT...
> >
> > http://activemq.apache.org/camel/seda.html
> >
> > Then the beans could be bound to URIs "edt:someName" then some route
> > could go from whatever the input is to the EDT uri?
> >
> > Or maybe we just have an EDT component which invokes beans? So binding to
> >
> > edt:beanName?methodName=foo
> >
>
> Yes, EDT=event dispatch thread, used by AWT and Swing and defines a "thread
> compartment" for all gui objects.

Ah cool, thanks


> As you say, implementing an edt component, like seda, makes more sense.
> I'll look at the seda component and cobble together an edt component.

Great! We love contributions...
http://activemq.apache.org/camel/contributing.html

Let us know if you need any help getting started etc.


> Note that there are two ways to dispatch, synchronously and asynchronously:
>
> SwingUtilities.invokeAndWait
> SwingUtilities.invokeLater
>
> If there is a need to participate in transactions invokeAndWait needs to be
> supported too...
> Can seda processors participate in transactions?

Currently not I'm afraid; as we're using the default threaded
transactions in Spring. Though it could work if we supported
transaction suspend & resume when switching threads. So those async
components (of which there's not many so far - just seda and the new
edt component) they could see if there's a current transaction,
suspend it & attach it to the Exchange so it can be resumed in the
other thread.

> ps. there is an SWT thread which is analogous but incompatible with the EDT,
> so SWT users may ask for an SWT component...

Thanks for the heads up!

-- 
James
-------
http://macstrac.blogspot.com/

Re: bean method invocations on EDT

Posted by "steven.marcus" <st...@gmail.com>.

James.Strachan wrote:
> 
> Whats the event driven thread? Are you talking Swing/UI stuff?
> 
> If so we could maybe have a component/endpoint to process messages in
> the EDT. e.g. like the SEDA component, but the messages would be
> processed in the EDT...
> 
> http://activemq.apache.org/camel/seda.html
> 
> Then the beans could be bound to URIs "edt:someName" then some route
> could go from whatever the input is to the EDT uri?
> 
> Or maybe we just have an EDT component which invokes beans? So binding to
> 
> edt:beanName?methodName=foo
> 

Yes, EDT=event dispatch thread, used by AWT and Swing and defines a "thread
compartment" for all gui objects.

As you say, implementing an edt component, like seda, makes more sense.
I'll look at the seda component and cobble together an edt component.

Note that there are two ways to dispatch, synchronously and asynchronously:

SwingUtilities.invokeAndWait
SwingUtilities.invokeLater

If there is a need to participate in transactions invokeAndWait needs to be
supported too...
Can seda processors participate in transactions?

thanks again!
Steven Marcus

ps. there is an SWT thread which is analogous but incompatible with the EDT,
so SWT users may ask for an SWT component...

-- 
View this message in context: http://www.nabble.com/bean-method-invocations-on-EDT-tf4329507s22882.html#a12339298
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: bean method invocations on EDT

Posted by James Strachan <ja...@gmail.com>.
On 8/26/07, steven.marcus <st...@gmail.com> wrote:
>
> Is there any chance that support for bean method invocations on the event
> dispatch thread could be added?
>
> The URI might look something like:
>
> bean:foo?methodName=addBar&EDT=true
>
> Some way to tell @MessageDriven that it should dispatch on the EDT would be
> really nice too...

Whats the event driven thread? Are you talking Swing/UI stuff?

If so we could maybe have a component/endpoint to process messages in
the EDT. e.g. like the SEDA component, but the messages would be
processed in the EDT...

http://activemq.apache.org/camel/seda.html

Then the beans could be bound to URIs "edt:someName" then some route
could go from whatever the input is to the EDT uri?

Or maybe we just have an EDT component which invokes beans? So binding to

edt:beanName?methodName=foo


> I'm new to camel, but so far the refactoring of our project where we try out
> using camel, spring, spring-javaconfig, and maven, is going very well. There
> has been a large reduction and simplification of the code, and a new clarity
> in the architecture... thanks!

Great, thats good to know!
-- 
James
-------
http://macstrac.blogspot.com/