Package org.onehippo.forge.camel.util
Class CamelContextUtils
java.lang.Object
org.onehippo.forge.camel.util.CamelContextUtils
Utility class to invoke CamelContext.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.
-
Constructor Details
-
CamelContextUtils
public CamelContextUtils()
-
-
Method Details
-
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
-