Package org.apache.camel

Examples of org.apache.camel.StatefulService


     *
     * @return <tt>true</tt> if already suspended, otherwise <tt>false</tt>
     */
    public static boolean isSuspended(Object value) {
        if (value instanceof StatefulService) {
            StatefulService service = (StatefulService) value;
            if (service.isSuspended() || service.isSuspending()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here


     *
     * @return <tt>true</tt> if already stopped, otherwise <tt>false</tt>
     */
    public static boolean isStopped(Object value) {
        if (value instanceof StatefulService) {
            StatefulService service = (StatefulService) value;
            if (service.isStopping() || service.isStopped()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     *
     * @return <tt>true</tt> if already started, otherwise <tt>false</tt>
     */
    public static boolean isStarted(Object value) {
        if (value instanceof StatefulService) {
            StatefulService service = (StatefulService) value;
            if (service.isStarting() || service.isStarted()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     *
     * @return <tt>true</tt> if already stopped, otherwise <tt>false</tt>
     */
    public static boolean isStopped(Object value) {
        if (value instanceof StatefulService) {
            StatefulService service = (StatefulService) value;
            if (service.isStopping() || service.isStopped()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     *
     * @return <tt>true</tt> if already started, otherwise <tt>false</tt>
     */
    public static boolean isStarted(Object value) {
        if (value instanceof StatefulService) {
            StatefulService service = (StatefulService) value;
            if (service.isStarting() || service.isStarted()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     *
     * @return <tt>true</tt> if already suspended, otherwise <tt>false</tt>
     */
    public static boolean isSuspended(Object value) {
        if (value instanceof StatefulService) {
            StatefulService service = (StatefulService) value;
            if (service.isSuspended() || service.isSuspending()) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

     * @param policy the policy
     * @return <tt>true</tt> to run
     */
    protected boolean isRoutePolicyRunAllowed(RoutePolicy policy) {
        if (policy instanceof StatefulService) {
            StatefulService ss = (StatefulService) policy;
            return ss.isRunAllowed();
        }
        return true;
    }
View Full Code Here

        return true;
    }

    private static boolean isCamelStopping(CamelContext context) {
        if (context instanceof StatefulService) {
            StatefulService ss = (StatefulService) context;
            return ss.isStopping() || ss.isStopped();
        }
        return false;
    }
View Full Code Here

        // log the merged route at info level to make it easier to end users to spot any mistakes they may have made
        log.info("AdviceWith route after: " + merged);

        // If the camel context is started then we start the route
        if (camelContext instanceof StatefulService) {
            StatefulService service = (StatefulService) camelContext;
            if (service.isStarted()) {
                camelContext.startRoute(merged);
            }
        }
        return merged;
    }
View Full Code Here

        // log the merged route at info level to make it easier to end users to spot any mistakes they may have made
        log.info("AdviceWith route after: " + merged);

        // If the camel context is started then we start the route
        if (camelContext instanceof StatefulService) {
            StatefulService service = (StatefulService) camelContext;
            if (service.isStarted()) {
                camelContext.startRoute(merged);
            }
        }
        return merged;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.StatefulService

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.