Package org.onehippo.forge.camel.util
Class CamelContextUtils
- java.lang.Object
-
- org.onehippo.forge.camel.util.CamelContextUtils
-
public class CamelContextUtils extends Object
Utility class to invoke CamelContext.
-
-
Constructor Summary
Constructors Constructor Description CamelContextUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
invokeManagedCamelContextMBean(String operation, Object[] params, String[] signature)
FindsManagedCamelContextMBean
s from the platform MBean server and invokes theoperation
withparams
of which signature is likesignature
on the first foundManagedCamelContextMBean
MBean.static Object
invokeManagedCamelContextMBean(String camelContextId, String operation, Object[] params, String[] signature)
Finds theManagedCamelContextMBean
havingcamelContextId
from the platform MBean server and invokes theoperation
withparams
of which signature is likesignature
on the foundManagedCamelContext
MBean.
-
-
-
Method Detail
-
invokeManagedCamelContextMBean
public static Object invokeManagedCamelContextMBean(String operation, Object[] params, String[] signature)
FindsManagedCamelContextMBean
s from the platform MBean server and invokes theoperation
withparams
of which signature is likesignature
on the first foundManagedCamelContextMBean
MBean.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 theManagedCamelContextMBean
havingcamelContextId
from the platform MBean server and invokes theoperation
withparams
of which signature is likesignature
on the foundManagedCamelContext
MBean. If a blankcamelContextId
provided, then it invokes the operation on the first foundManagedCamelContextMBean
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 IDoperation
- operation nameparams
- parameters arraysignature
- signature of parameters- Returns:
- operation return
-
-