Package org.apache.camel

Examples of org.apache.camel.ServiceStatus


    }

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getStatusText() {
        ServiceStatus status = getStatus();
        if (status != null) {
            return status.toString();
        }
        return null;
    }
View Full Code Here


    }

    public String getState() {
        // must use String type to be sure remote JMX can read the attribute without requiring Camel classes.
        if (service instanceof StatefulService) {
            ServiceStatus status = ((StatefulService) service).getStatus();
            return status.name();
        }

        // assume started if not a ServiceSupport instance
        return ServiceStatus.Started.name();
    }
View Full Code Here

    }

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getStatusText() {
        ServiceStatus status = getStatus();
        if (status != null) {
            return status.toString();
        }
        return null;
    }
View Full Code Here

    /**
     * Returns the status of the route if it has been registered with a {@link CamelContext}
     */
    public ServiceStatus getStatus(CamelContext camelContext) {
        if (camelContext != null) {
            ServiceStatus answer = camelContext.getRouteStatus(this.getId());
            if (answer == null) {
                answer = ServiceStatus.Stopped;
            }
            return answer;
        }
View Full Code Here

        }
        return null;
    }

    public boolean isStartable(CamelContext camelContext) {
        ServiceStatus status = getStatus(camelContext);
        if (status == null) {
            return true;
        } else {
            return status.isStartable();
        }
    }
View Full Code Here

            return status.isStartable();
        }
    }

    public boolean isStoppable(CamelContext camelContext) {
        ServiceStatus status = getStatus(camelContext);
        if (status == null) {
            return false;
        } else {
            return status.isStoppable();
        }
    }
View Full Code Here

        for (CamelContext camelContext : camelContexts) {
            List<RouteDefinition> routeDefinitions = camelController.getRouteDefinitions(camelContext.getName());
            if (routeDefinitions != null && !routeDefinitions.isEmpty()) {
                for (RouteDefinition routeDefinition : routeDefinitions) {
                    String contextName = camelContext.getName();
                    ServiceStatus status = camelContext.getRouteStatus(routeDefinition.getId());
                    System.out.println(String.format(OUTPUT_FORMAT, routeDefinition.getId(), contextName, status != null ? status.name() : UNKNOWN));
                }
            }
        }

        return null;
View Full Code Here

    }

    protected String getState(Endpoint endpoint) {
        // must use String type to be sure remote JMX can read the attribute without requiring Camel classes.
        if (endpoint instanceof StatefulService) {
            ServiceStatus status = ((StatefulService) endpoint).getStatus();
            return status.name();
        }

        // assume started if not a ServiceSupport instance
        return ServiceStatus.Started.name();
    }
View Full Code Here

    /**
     * Returns the status of the route if it has been registered with a {@link CamelContext}
     */
    public ServiceStatus getStatus() {
        if (camelContext != null) {
            ServiceStatus answer = camelContext.getRouteStatus(this);
            if (answer == null) {
                answer = ServiceStatus.Stopped;
            }
            return answer;
        }
View Full Code Here

        }
        return null;
    }

    public boolean isStartable() {
        ServiceStatus status = getStatus();
        if (status == null) {
            return true;
        } else {
            return status.isStartable();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.ServiceStatus

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.