Examples of OutputModule


Examples of org.apache.cocoon.components.modules.output.OutputModule

                conn.commit();
            }

            // obtain output mode module and rollback output
            ServiceSelector outputSelector = null;
            OutputModule output = null;
            try {
                outputSelector = (ServiceSelector) this.manager.lookup(OUTPUT_MODULE_SELECTOR);
                if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode)){
                    output = (OutputModule) outputSelector.select(outputMode);
                }
                if (output != null) {
                    output.commit(null, objectModel);
                } else if (getLogger().isWarnEnabled()) {
                    getLogger().warn("Could not select output mode " + outputMode);
                }
            } catch (ServiceException e) {
                if (getLogger().isWarnEnabled()) {
                    getLogger().warn("Could not select output mode " + outputMode + ":" + e.getMessage());
                }
            } finally {
                if (outputSelector != null) {
                    if (output != null) {
                        outputSelector.release(output);
                    }
                    this.manager.release(outputSelector);
                }
            }
        } catch (Exception e) {
            failed = true;
            if ( conn != null ) {
                try {
                    if (getLogger().isDebugEnabled()) {
                        getLogger().debug( "Rolling back transaction. Caused by " + e.getMessage() );
                        e.printStackTrace();
                    }
                    conn.rollback();
                    results = null;

                    // obtain output mode module and commit output
                    ServiceSelector outputSelector = null;
                    OutputModule output = null;
                    try {
                        outputSelector = (ServiceSelector) this.manager.lookup(OUTPUT_MODULE_SELECTOR);
                        if (outputMode != null && outputSelector != null && outputSelector.isSelectable(outputMode)){
                            output = (OutputModule) outputSelector.select(outputMode);
                        }
                        if (output != null) {
                            output.rollback( null, objectModel, e);
                        } else if (getLogger().isWarnEnabled()) {
                            getLogger().warn("Could not select output mode " + outputMode);
                        }
                    } catch (ServiceException e2) {
                        if (getLogger().isWarnEnabled()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.