Package org.switchyard.component.jca.processor

Examples of org.switchyard.component.jca.processor.AbstractOutboundProcessor


        ProcessorModel processorModel = outboundInteractionModel.getProcessor();
        if (processorModel == null) {
            throw JCAMessages.MESSAGES.noProcessorConfigured();
        }
        Properties processorProps = processorModel.getProperties();
        AbstractOutboundProcessor processor = null;
        String processorClassName = processorModel.getProcessorClassName();
        Class<?> processorClass = null;
        try {
            processorClass = (Class<?>)_appClassLoader.loadClass(processorClassName);
            processor = (AbstractOutboundProcessor) processorClass.newInstance();
            if (!processorProps.isEmpty()) {
                PropertyEditors.mapJavaBeanProperties(processor, processorProps);
            }
        } catch (Exception e) {
            throw JCAMessages.MESSAGES.outboundProcessorClass(processorClassName, e);
        }
       
        ConnectionModel connectionModel = outboundConnectionModel.getConnection();
        if (connectionModel == null) {
            throw JCAMessages.MESSAGES.noConnectionConfigured();
        }
        String cfJndiName = connectionModel.getConnectionFactoryJNDIName();
        Properties connProps = connectionModel.getProperties();
        processor.setApplicationClassLoader(_appClassLoader)
                    .setMCFProperties(connProps)
                    .setConnectionFactoryJNDIName(cfJndiName)
                    .setJCABindingModel(jcaconfig);

        ConnectionSpecModel connectionSpecModel = outboundInteractionModel.getConnectionSpec();
        if (connectionSpecModel != null) {
            String connSpecClassName = connectionSpecModel.getConnectionSpecClassName();
            Properties connSpecProps = connectionSpecModel.getProperties();
            processor.setConnectionSpec(connSpecClassName, connSpecProps);
        }
        InteractionSpecModel interactionSpecModel = outboundInteractionModel.getInteractionSpec();
        if (interactionSpecModel != null) {
            String interactSpecClassName = interactionSpecModel.getInteractionSpecClassName();
            Properties interactSpecProps = interactionSpecModel.getProperties();
            processor.setInteractionSpec(interactSpecClassName, interactSpecProps);
        }

        return new OutboundHandler(processor, getServiceDomain());
    }
View Full Code Here

TOP

Related Classes of org.switchyard.component.jca.processor.AbstractOutboundProcessor

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.