Package org.milyn.event.types

Examples of org.milyn.event.types.ResourceTargetingEvent


                    continue;
                }

                // Register the targeting event...
                if(eventListener != null) {
                    eventListener.onEvent(new ResourceTargetingEvent(element, config));
                }

                if(logger.isDebugEnabled()) {
                    logger.debug("Applying serialisation resource [" + config + "] to element [" + DomUtils.getXPath(element) + "].");
                }
View Full Code Here


                continue;
            }

            // Register the targeting event.  No need to register it again in the visitAfter loop...
            if (eventListener != null) {
                eventListener.onEvent(new ResourceTargetingEvent(element, config, VisitSequence.BEFORE, VisitPhase.ASSEMBLY));
            }

            DOMVisitBefore assemblyUnit = configMap.getContentHandler();
            try {
                if (logger.isDebugEnabled()) {
View Full Code Here

            // costly.

            if(visitSequence == VisitSequence.BEFORE) {
                // Register the targeting event...
                if (eventListener != null) {
                    eventListener.onEvent(new ResourceTargetingEvent(element, config, VisitSequence.BEFORE));
                }

                DOMVisitBefore visitor = (DOMVisitBefore) configMap.getContentHandler();
                try {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Applying processing resource [" + config + "] to element [" + DomUtils.getXPath(element) + "] before applying resources to its child elements.");
                    }
                    visitor.visitBefore(element, executionContext);
                    if (eventListener != null) {
                        eventListener.onEvent(new ElementVisitEvent(element, configMap, VisitSequence.BEFORE));
                    }
                } catch (Throwable e) {
                    String errorMsg = "Failed to apply processing unit [" + visitor.getClass().getName() + "] to [" + executionContext.getDocumentSource() + ":" + DomUtils.getXPath(element) + "].";
                    processVisitorException(element, e, configMap, VisitSequence.BEFORE, errorMsg);
                }
            } else if(visitSequence == VisitSequence.AFTER) {
                // Register the targeting event...
                if (eventListener != null) {
                    eventListener.onEvent(new ResourceTargetingEvent(element, config, VisitSequence.AFTER));
                }

                DOMVisitAfter visitor = (DOMVisitAfter) configMap.getContentHandler();
                try {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Applying processing resource [" + config + "] to element [" + DomUtils.getXPath(element) + "] after applying resources to its child elements.");
                    }
                    visitor.visitAfter(element, executionContext);
                    if (eventListener != null) {
                        eventListener.onEvent(new ElementVisitEvent(element, configMap, VisitSequence.AFTER));
                    }
                } catch (Throwable e) {
                    String errorMsg = "Failed to apply processing unit [" + visitor.getClass().getName() + "] to [" + executionContext.getDocumentSource() + ":" + DomUtils.getXPath(element) + "].";
                    processVisitorException(element, e, configMap, VisitSequence.BEFORE, errorMsg);
                }
            } else if(visitSequence == VisitSequence.CLEAN) {
                // Register the targeting event...
                if (eventListener != null) {
                    eventListener.onEvent(new ResourceTargetingEvent(element, config, VisitSequence.CLEAN));
                }

                ContentHandler contentHandler = configMap.getContentHandler();
                if(contentHandler instanceof VisitLifecycleCleanable) {
                    VisitLifecycleCleanable visitor = (VisitLifecycleCleanable) contentHandler;
View Full Code Here

                    try {
                        if(mapping.getResourceConfig().isTargetedAtElement(currentProcessor.element, execContext)) {
                            mapping.getContentHandler().visitBefore(currentProcessor.element, execContext);
                            // Register the targeting event.  No need to register this event again on the visitAfter...
                            if(eventListener != null) {
                                eventListener.onEvent(new ResourceTargetingEvent(element, mapping.getResourceConfig(), VisitSequence.BEFORE));
                                eventListener.onEvent(new ElementVisitEvent(element, mapping, VisitSequence.BEFORE));
                            }
                        }
                    } catch(Throwable t) {
                        String errorMsg = "Error in '" + mapping.getContentHandler().getClass().getName() + "' while processing the visitBefore event.";
View Full Code Here

TOP

Related Classes of org.milyn.event.types.ResourceTargetingEvent

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.