You could learn angularjs (instead of JSF) and camel together, which
is way cooler and more fun - then hack on hawtio :)

More below...

On 17 July 2013 20:18, lassesvestergaard <lassesvesterga...@gmail.com> wrote:
> Hi all.
>
> I'm learning camel and jsf at the same time. What I want to do is to create
> a jsf web application where it is possible to create, edit and delete
> routes. This means that I need to have camel running in the background for
> ever. I want to put camel inside a war, and when the application is deployed
> on a tomcat server, Camel will start and I can begin making routes through a
> browser.
>
> My initial problem is that I don't know how to run camel in the background
> of a jsf application. Web applications are only request scoped, so how do i
> configure jsf to keep part of the web application alive constantly? I know
> this is not directly related to Camel, but it's part of my problem and I
> decided to start from this forum. Please post any articles you might find
> relevant on this matter.
>
> My next issue is more directly related to camel. I want to be able to create
> routes with anonymous Processor objects (for simple conversion of data). As
> far as I understand it, this is only possible through native java, and not
> using xml. This means that I can't create anonymous Processor objects with
> ex. Spring. Furthermore I can't use the "Camel web applications without
> Spring example"
> (http://www.javacodegeeks.com/2013/01/camel-2-11-camel-web-applications-without-spring.html).
> Is this correctly understood? If not, please provide a link to where I can
> learn more.
>
> I know about hawt.io, and it seems like you can't create an anonymous
> Processor objects there either.

In Camel XML you can't create an anonymous inner class for a Processor
(since that requires Java source and a Java compiler); so hawtio has
the same limitation. Though if you write some Java bean/processor and
register it into your registry (JNDI / Spring / CDI / guice /
whatever) you can then reference it from the XML DSL (and so from
hawtio, Fuse IDE etc)

So a simpler solution than creating anonymous Processors is just to
create Java methods and then invoke them from the Camel DSL (e.g.
method call expressions or using bean integration)
http://camel.apache.org/bean-integration.html

or if its for converting between different data types; then Camel's
type conversion approach is pretty good:
http://camel.apache.org/type-converter.html

--
James
-------
Red Hat

Email: jstra...@redhat.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/

Open Source Integration

Reply via email to