Hi,

I am trying to access ComponentContext inside servicemix-camel. I tried the
following two approaches 

1. created the following property inside the class which implements the
route builder

 private javax.jbi.component.ComponentContext context;

   public void setContext(ComponentContext context) {
                this.context = context;
        }
 Expecting the dependency to be injected into the class extending the route
builder as suggested by some forums. But it did not work.

 2. I tried the following configuration with the xbean.xml of the camel 

 <bean id="JobPollerService" class="poller.service.JobPollerService">
     <property name="servicemixclient" ref="client" /> 
  </bean>
  
  <bean id="client"
class="org.apache.servicemix.client.DefaultServiceMixClient">
     <constructor-arg ref="jbi" />
  </bean>

and in the camel router I implemented the following method

public static DefaultServiceMixClient client;
        public void setContext(DefaultServiceMixClient client) {
                log.debug("Injecting component context");
                this.client= client;
        }

here it failed to create the bean client saying that the constructor is
incorrect. what is the right way to access ComponentContext or to create
servicemixclient inside the servicemix-camel component.

Regards,
Ganesh
-- 
View this message in context: 
http://www.nabble.com/How-to-access-ComponentContext-inside-servicemix-camel-tp22972903p22972903.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to