Package org.apache.camel

Examples of org.apache.camel.Service


            CamelContextAware aware = (CamelContextAware) object;
            aware.setCamelContext(this);
        }

        if (object instanceof Service) {
            Service service = (Service) object;

            for (LifecycleStrategy strategy : lifecycleStrategies) {
                if (service instanceof Endpoint) {
                    // use specialized endpoint add
                    strategy.onEndpointAdd((Endpoint) service);
View Full Code Here


        }
    }

    public boolean removeService(Object object) throws Exception {
        if (object instanceof Service) {
            Service service = (Service) object;

            for (LifecycleStrategy strategy : lifecycleStrategies) {
                if (service instanceof Endpoint) {
                    // use specialized endpoint remove
                    strategy.onEndpointRemove((Endpoint) service);
View Full Code Here

        return false;
    }

    public boolean hasService(Object object) {
        if (object instanceof Service) {
            Service service = (Service) object;
            return servicesToClose.contains(service);
        }
        return false;
    }
View Full Code Here

        }

        // start notifiers as services
        for (EventNotifier notifier : getManagementStrategy().getEventNotifiers()) {
            if (notifier instanceof Service) {
                Service service = (Service) notifier;
                for (LifecycleStrategy strategy : lifecycleStrategies) {
                    strategy.onServiceAdd(this, service, null);
                }
            }
            if (notifier instanceof Service) {
View Full Code Here

        }
    }

    public void addService(Object object) throws Exception {
        if (object instanceof Service) {
            Service service = (Service) object;
            for (LifecycleStrategy strategy : lifecycleStrategies) {
                strategy.onServiceAdd(this, service, null);
            }
            servicesToClose.add(service);
        }
View Full Code Here

    /**
     * Starts all of the given services
     */
    public static void startService(Object value) throws Exception {
        if (value instanceof Service) {
            Service service = (Service)value;
            if (LOG.isTraceEnabled()) {
                LOG.trace("Starting service: " + service);
            }
            service.start();
        } else if (value instanceof Collection) {
            startServices((Collection<?>)value);
        }
    }
View Full Code Here

     * Starts all of the given services
     */
    public static void startServices(Collection<?> services) throws Exception {
        for (Object value : services) {
            if (value instanceof Service) {
                Service service = (Service)value;
                if (LOG.isTraceEnabled()) {
                    LOG.trace("Starting service: " + service);
                }
                service.start();
            }
        }
    }
View Full Code Here

    /**
     * Stops all of the given services, throwing the first exception caught
     */
    public static void stopService(Object value) throws Exception {
        if (value instanceof Service) {
            Service service = (Service)value;
            if (LOG.isTraceEnabled()) {
                LOG.trace("Stopping service " + value);
            }
            service.stop();
        } else if (value instanceof Collection) {
            stopServices((Collection<?>)value);
        }
    }
View Full Code Here

     */
    public static void stopServices(Collection<?> services) throws Exception {
        Exception firstException = null;
        for (Object value : services) {
            if (value instanceof Service) {
                Service service = (Service)value;
                try {
                    if (LOG.isTraceEnabled()) {
                        LOG.trace("Stopping service: " + service);
                    }
                    service.stop();
                } catch (Exception e) {
                    if (LOG.isDebugEnabled()) {
                        LOG.debug("Caught exception stopping service: " + service, e);
                    }
                    if (firstException == null) {
View Full Code Here

            // only start service if not already started
            LOG.trace("Service already started: {}", value);
            return;
        }
        if (value instanceof Service) {
            Service service = (Service)value;
            LOG.trace("Starting service: {}", service);
            service.start();
        } else if (value instanceof Collection) {
            startServices((Collection<?>)value);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.Service

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.