209.4.4. KuraRouter activator 回调
Kura 路由器附带生命周期回调,可用于自定义 Camel 路由器的工作方式。例如,要配置与路由器关联的 CamelContext
实例,请在前者启动前覆盖 KuraRouter
类的 beforeStart
方法:
public class MyKuraRouter extends KuraRouter { ... protected void beforeStart(CamelContext camelContext) { OsgiDefaultCamelContext osgiContext = (OsgiCamelContext) camelContext; osgiContext.setName("NameOfTheRouter"); } }