Package org.mule.api.lifecycle

Examples of org.mule.api.lifecycle.LifecyclePhase


        String lastPhase = NotInLifecyclePhase.PHASE_NAME;
        for (String phase : completedPhases)
        {
            if(isDirectTransition(lastPhase, phase))
            {
                LifecyclePhase lp = phases.get(phase);
                lp.applyLifecycle(object);
                lastPhase = phase;
            }
        }
    }
View Full Code Here


         */
        protected transient final Log logger = LogFactory.getLog(RegistryLifecycleCallback.class);

        public void onTransition(String phaseName, Object object) throws MuleException
        {
            LifecyclePhase phase = phases.get(phaseName);

            if (logger.isDebugEnabled())
            {
                logger.debug("Applying lifecycle phase: " + phase + " for registry: " + object.getClass().getSimpleName());
            }

            if (phase instanceof ContainerManagedLifecyclePhase)
            {
                phase.applyLifecycle(object);
                return;
            }

            // overlapping interfaces can cause duplicates
            Set<Object> duplicates = new HashSet<Object>();

            for (LifecycleObject lo : phase.getOrderedLifecycleObjects())
            {
                // TODO Collection -> List API refactoring
                Collection<?> targetsObj = getLifecycleObject().lookupObjectsForLifecycle(lo.getType());
                List<Object> targets = new LinkedList<Object>(targetsObj);
                if (targets.size() == 0)
                {
                    continue;
                }

                lo.firePreNotification(muleContext);

                for (Iterator<Object> target = targets.iterator(); target.hasNext();)
                {
                    Object o = target.next();
                    if (duplicates.contains(o))
                    {
                        target.remove();
                    }
                    else
                    {
                        if (logger.isDebugEnabled())
                        {
                            logger.debug("lifecycle phase: " + phase.getName() + " for object: " + o);
                        }
                        phase.applyLifecycle(o);
                        target.remove();
                        duplicates.add(o);
                    }
                }

View Full Code Here

        String lastPhase = NotInLifecyclePhase.PHASE_NAME;
        for (String phase : completedPhases)
        {
            if(isDirectTransition(lastPhase, phase))
            {
                LifecyclePhase lp = phases.get(phase);
                lp.applyLifecycle(object);
                lastPhase = phase;
            }
        }
    }
View Full Code Here

         */
        protected transient final Log logger = LogFactory.getLog(RegistryLifecycleCallback.class);

        public void onTransition(String phaseName, Object object) throws MuleException
        {
            LifecyclePhase phase = phases.get(phaseName);

            if (logger.isDebugEnabled())
            {
                logger.debug("Applying lifecycle phase: " + phase + " for registry: " + object.getClass().getSimpleName());
            }

            if (phase instanceof ContainerManagedLifecyclePhase)
            {
                phase.applyLifecycle(object);
                return;
            }

            // overlapping interfaces can cause duplicates
            Set<Object> duplicates = new HashSet<Object>();

            for (LifecycleObject lo : phase.getOrderedLifecycleObjects())
            {
                // TODO Collection -> List API refactoring
                Collection<?> targetsObj = getLifecycleObject().lookupObjectsForLifecycle(lo.getType());
                List<Object> targets = new LinkedList<Object>(targetsObj);
                if (targets.size() == 0)
                {
                    continue;
                }

                lo.firePreNotification(muleContext);

                for (Iterator<Object> target = targets.iterator(); target.hasNext();)
                {
                    Object o = target.next();
                    if (duplicates.contains(o))
                    {
                        target.remove();
                    }
                    else
                    {
                        if (logger.isDebugEnabled())
                        {
                            logger.debug("lifecycle phase: " + phase.getName() + " for object: " + o);
                        }
                        phase.applyLifecycle(o);
                        target.remove();
                        duplicates.add(o);
                    }
                }

View Full Code Here

TOP

Related Classes of org.mule.api.lifecycle.LifecyclePhase

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.