public <T extends ManagedProcessorMBean> T getManagedProcessor(String id, Class<T> type) { // jmx must be enabled if (getManagementStrategy().getManagementAgent() == null) { return null; } Processor processor = getProcessor(id); ProcessorDefinition def = getProcessorDefinition(id); if (processor != null && def != null) { try { ObjectName on = getManagementStrategy().getManagementNamingStrategy().getObjectNameForProcessor(this, processor, def); return getManagementStrategy().getManagementAgent().newProxyClient(on, type); } catch (MalformedObjectNameException e) { throw ObjectHelper.wrapRuntimeCamelException(e); } } return null; }
@Override public int compare(ManagedProcessorMBean o1, ManagedProcessorMBean o2) { return o1.getIndex().compareTo(o2.getIndex()); }
@Override public <T extends ManagedProcessorMBean> T getManagedProcessor(String id, Class<T> type) { return context.getManagedProcessor(id, type); }
/** * Gets the managed processor client api from any of the routes which with the given id * * @param id id of the processor * @param type the managed processor type from the {@link org.apache.camel.api.management.mbean} package. * @return the processor or <tt>null</tt> if not found * @throws IllegalArgumentException if the type is not compliant */ <T extends ManagedProcessorMBean> T getManagedProcessor(String id, Class<T> type);