Class CamelContextUtils


  • public class CamelContextUtils
    extends Object
    Utility class to invoke CamelContext.
    • Constructor Detail

      • CamelContextUtils

        public CamelContextUtils()
    • Method Detail

      • invokeManagedCamelContextMBean

        public static Object invokeManagedCamelContextMBean​(String operation,
                                                            Object[] params,
                                                            String[] signature)
        Finds ManagedCamelContextMBeans from the platform MBean server and invokes the operation with params of which signature is like signature on the first found ManagedCamelContextMBean MBean.

        Example code:

         CamelContextUtils.invokeManagedCamelContextMBean("sendBody", new Object [] { "direct:test", body }, new String {} { String.class.getName(), Object.class.getName() });;
         
        Parameters:
        operation - operation name
        params - parameters array
        signature - signature of parameters
        Returns:
        operation return
      • invokeManagedCamelContextMBean

        public static Object invokeManagedCamelContextMBean​(String camelContextId,
                                                            String operation,
                                                            Object[] params,
                                                            String[] signature)
        Finds the ManagedCamelContextMBean having camelContextId from the platform MBean server and invokes the operation with params of which signature is like signature on the found ManagedCamelContext MBean. If a blank camelContextId provided, then it invokes the operation on the first found ManagedCamelContextMBean MBean.

        Example code:

         CamelContextUtils.invokeManagedCamelContextMBean("camel-1", "sendBody", new Object [] { "direct:test", body }, new String {} { String.class.getName(), Object.class.getName() });;
         
        Parameters:
        camelContextId - camel context ID
        operation - operation name
        params - parameters array
        signature - signature of parameters
        Returns:
        operation return