@ManagedAttribute(description = "Processor State")
public String getState() {
// must use String type to be sure remote JMX can read the attribute without requiring Camel classes.
if (processor instanceof ServiceSupport) {
ServiceStatus status = ((ServiceSupport) processor).getStatus();
// if no status exists then its stopped
if (status == null) {
status = ServiceStatus.Stopped;
}
return status.name();
}
// assume started if not a ServiceSupport instance
return ServiceStatus.Started.name();
}