Package org.onehippo.forge.camel.util
Class CamelContextUtils
java.lang.Object
org.onehippo.forge.camel.util.CamelContextUtils
Utility class to invoke CamelContext.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectinvokeManagedCamelContextMBean(String operation, Object[] params, String[] signature) FindsManagedCamelContextMBeans from the platform MBean server and invokes theoperationwithparamsof which signature is likesignatureon the first foundManagedCamelContextMBeanMBean.static ObjectinvokeManagedCamelContextMBean(String camelContextId, String operation, Object[] params, String[] signature) Finds theManagedCamelContextMBeanhavingcamelContextIdfrom the platform MBean server and invokes theoperationwithparamsof which signature is likesignatureon the foundManagedCamelContextMBean.
-
Constructor Details
-
CamelContextUtils
public CamelContextUtils()
-
-
Method Details
-
invokeManagedCamelContextMBean
public static Object invokeManagedCamelContextMBean(String operation, Object[] params, String[] signature) FindsManagedCamelContextMBeans from the platform MBean server and invokes theoperationwithparamsof which signature is likesignatureon the first foundManagedCamelContextMBeanMBean.Example code:
CamelContextUtils.invokeManagedCamelContextMBean("sendBody", new Object [] { "direct:test", body }, new String {} { String.class.getName(), Object.class.getName() });;- Parameters:
operation- operation nameparams- parameters arraysignature- signature of parameters- Returns:
- operation return
-
invokeManagedCamelContextMBean
public static Object invokeManagedCamelContextMBean(String camelContextId, String operation, Object[] params, String[] signature) Finds theManagedCamelContextMBeanhavingcamelContextIdfrom the platform MBean server and invokes theoperationwithparamsof which signature is likesignatureon the foundManagedCamelContextMBean. If a blankcamelContextIdprovided, then it invokes the operation on the first foundManagedCamelContextMBeanMBean.Example code:
CamelContextUtils.invokeManagedCamelContextMBean("camel-1", "sendBody", new Object [] { "direct:test", body }, new String {} { String.class.getName(), Object.class.getName() });;- Parameters:
camelContextId- camel context IDoperation- operation nameparams- parameters arraysignature- signature of parameters- Returns:
- operation return
-