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