camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjb <jj_burf...@yahoo.com>
Subject bean binding with inheritance & 2.0-M3 camel-http
Date Tue, 04 Aug 2009 05:52:05 GMT

I have a hierarchy of objects which looks like this:

public BaseClass implements javax.jms.MessageListener
{
    public void onMessage(javax.jms.Message message)
    {
        // do something
    }
}

public DerivedClass extends BaseClass
{
    public void process(String body)
    {
        // do something
    }
}

I then have the following XML in my camel-context.xml:

<bean id="processor" class="DerivedClass"/>

<route>
      <from uri="activemq:request.queue"/>
      <to uri="bean:processor?method=process"/>
</route>

When I run this code, all messages from request.queue always go to
BaseClass.onMessage, even though I explicitly want them to go to
DerivedClass.process.  Have I done something wrong or is this a bug (I read
through the bean binding and it said it would first use methods that were
explicitly specified in the bean's method parameter)?

I also notice that the new 2.0-M3 version of camel-http no longer contains
the class org.apache.camel.component.http.HttpExchange.  Therefore, this
code no longer compiles:

	public void process(Exchange exchange)
	{
		try
		{
			HttpServletResponse response = ((HttpExchange)exchange).getResponse();
			HttpServletRequest request = ((HttpExchange)exchange).getRequest();
			HttpSession session = null;
			if (request != null)
				session = request.getSession(true);
                 }
                catch (Exception e)
                { e.printStackTrace(); }
         }

Is there a new way to get the HttpServletResponse and such from the Exchange
parameter?

Regards
-- 
View this message in context: http://www.nabble.com/bean-binding-with-inheritance---2.0-M3-camel-http-tp24802648p24802648.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message