Package org.switchyard.component.common.knowledge.config.model.v1

Examples of org.switchyard.component.common.knowledge.config.model.v1.V1InputsModel


        if (channelAnnotations == null || channelAnnotations.length == 0) {
            return null;
        }
        ChannelsModel channelsModel = new V1ChannelsModel(knowledgeNamespace.uri());
        for (Channel channelAnnotation : channelAnnotations) {
            ChannelModel channelModel = new V1ChannelModel(knowledgeNamespace.uri());
            Class<? extends org.kie.api.runtime.Channel> clazz = channelAnnotation.value();
            if (Channel.UndefinedChannel.class.isAssignableFrom(clazz)) {
                clazz = SwitchYardServiceChannel.class;
            }
            channelModel.setClazz(clazz);
            String name = channelAnnotation.name();
            if (UNDEFINED.equals(name)) {
                org.kie.api.runtime.Channel c = Construction.construct(clazz);
                if (c instanceof SwitchYardServiceChannel) {
                    SwitchYardServiceChannel sysc = (SwitchYardServiceChannel)c;
                    if (sysc.getName() != null) {
                        name = sysc.getName();
                    }
                }
            }
            if (UNDEFINED.equals(name)) {
                name = clazz.getSimpleName();
            }
            channelModel.setName(name);
            String operation = channelAnnotation.operation();
            if (!UNDEFINED.equals(operation)) {
                channelModel.setOperation(operation);
            }
            String reference = channelAnnotation.reference();
            if (!UNDEFINED.equals(reference)) {
                channelModel.setReference(reference);
                ComponentReferenceModel componentReferenceModel = new V1ComponentReferenceModel(switchyardNamespace.uri());
                componentReferenceModel.setName(reference);
                Class<?> interfaze = channelAnnotation.interfaze();
                if (!Channel.UndefinedInterface.class.isAssignableFrom(interfaze)) {
                    InterfaceModel interfaceModel = new V1InterfaceModel(InterfaceModel.JAVA);
View Full Code Here


     */
    protected ChannelsModel toChannelsModel(Channel[] channelAnnotations, KnowledgeNamespace knowledgeNamespace, ComponentModel componentModel, SwitchYardNamespace switchyardNamespace) {
        if (channelAnnotations == null || channelAnnotations.length == 0) {
            return null;
        }
        ChannelsModel channelsModel = new V1ChannelsModel(knowledgeNamespace.uri());
        for (Channel channelAnnotation : channelAnnotations) {
            ChannelModel channelModel = new V1ChannelModel(knowledgeNamespace.uri());
            Class<? extends org.kie.api.runtime.Channel> clazz = channelAnnotation.value();
            if (Channel.UndefinedChannel.class.isAssignableFrom(clazz)) {
                clazz = SwitchYardServiceChannel.class;
            }
            channelModel.setClazz(clazz);
            String name = channelAnnotation.name();
            if (UNDEFINED.equals(name)) {
                org.kie.api.runtime.Channel c = Construction.construct(clazz);
                if (c instanceof SwitchYardServiceChannel) {
                    SwitchYardServiceChannel sysc = (SwitchYardServiceChannel)c;
                    if (sysc.getName() != null) {
                        name = sysc.getName();
                    }
                }
            }
            if (UNDEFINED.equals(name)) {
                name = clazz.getSimpleName();
            }
            channelModel.setName(name);
            String operation = channelAnnotation.operation();
            if (!UNDEFINED.equals(operation)) {
                channelModel.setOperation(operation);
            }
            String reference = channelAnnotation.reference();
            if (!UNDEFINED.equals(reference)) {
                channelModel.setReference(reference);
                ComponentReferenceModel componentReferenceModel = new V1ComponentReferenceModel(switchyardNamespace.uri());
                componentReferenceModel.setName(reference);
                Class<?> interfaze = channelAnnotation.interfaze();
                if (!Channel.UndefinedInterface.class.isAssignableFrom(interfaze)) {
                    InterfaceModel interfaceModel = new V1InterfaceModel(InterfaceModel.JAVA);
                    interfaceModel.setInterface(interfaze.getName());
                    componentReferenceModel.setInterface(interfaceModel);
                    componentModel.addReference(componentReferenceModel);
                }
            }
            channelsModel.addChannel(channelModel);
        }
        return channelsModel;
    }
View Full Code Here

     */
    protected ContainerModel toContainerModel(Container containerAnnotation, KnowledgeNamespace knowledgeNamespace) {
        if (containerAnnotation == null) {
            return null;
        }
        ContainerModel containerModel = new V1ContainerModel(knowledgeNamespace.uri());
        String baseName = containerAnnotation.baseName();
        if (!UNDEFINED.equals(baseName)) {
            containerModel.setBaseName(baseName);
        }
        String releaseId = containerAnnotation.releaseId();
        if (!UNDEFINED.equals(releaseId)) {
            containerModel.setReleaseId(releaseId);
        }
        boolean scan = containerAnnotation.scan();
        if (scan) {
            containerModel.setScan(scan);
        }
        long scanInterval = containerAnnotation.scanInterval();
        if (scanInterval > 0) {
            containerModel.setScanInterval(Long.valueOf(scanInterval));
        }
        String sessionName = containerAnnotation.sessionName();
        if (!UNDEFINED.equals(sessionName)) {
            containerModel.setSessionName(sessionName);
        }
        return containerModel;
    }
View Full Code Here

    protected FaultsModel toFaultsModel(Fault[] faults, KnowledgeNamespace knowledgeNamespace) {
        FaultsModel faultsModel = null;
        if (faults != null) {
            for (Fault fault : faults) {
                if (fault != null) {
                    FaultModel faultModel = new V1FaultModel(knowledgeNamespace.uri());
                    String from = fault.from();
                    if (!UNDEFINED.equals(from)) {
                        faultModel.setFrom(from);
                    }
                    String to = fault.to();
                    if (!UNDEFINED.equals(to)) {
                        faultModel.setTo(to);
                    }
                    if (faultsModel == null) {
                        faultsModel = new V1FaultsModel(knowledgeNamespace.uri());
                    }
                    faultsModel.addFault(faultModel);
View Full Code Here

                    String to = fault.to();
                    if (!UNDEFINED.equals(to)) {
                        faultModel.setTo(to);
                    }
                    if (faultsModel == null) {
                        faultsModel = new V1FaultsModel(knowledgeNamespace.uri());
                    }
                    faultsModel.addFault(faultModel);
                }
            }
        }
View Full Code Here

    protected GlobalsModel toGlobalsModel(Global[] globals, KnowledgeNamespace knowledgeNamespace) {
        GlobalsModel globalsModel = null;
        if (globals != null) {
            for (Global global : globals) {
                if (global != null) {
                    GlobalModel globalModel = new V1GlobalModel(knowledgeNamespace.uri());
                    String from = global.from();
                    if (!UNDEFINED.equals(from)) {
                        globalModel.setFrom(from);
                    }
                    String to = global.to();
                    if (!UNDEFINED.equals(to)) {
                        globalModel.setTo(to);
                    }
                    if (globalsModel == null) {
                        globalsModel = new V1GlobalsModel(knowledgeNamespace.uri());
                    }
                    globalsModel.addGlobal(globalModel);
View Full Code Here

                    String to = global.to();
                    if (!UNDEFINED.equals(to)) {
                        globalModel.setTo(to);
                    }
                    if (globalsModel == null) {
                        globalsModel = new V1GlobalsModel(knowledgeNamespace.uri());
                    }
                    globalsModel.addGlobal(globalModel);
                }
            }
        }
View Full Code Here

    protected InputsModel toInputsModel(Input[] inputs, KnowledgeNamespace knowledgeNamespace) {
        InputsModel inputsModel = null;
        if (inputs != null) {
            for (Input input : inputs) {
                if (input != null) {
                    InputModel inputModel = new V1InputModel(knowledgeNamespace.uri());
                    String from = input.from();
                    if (!UNDEFINED.equals(from)) {
                        inputModel.setFrom(from);
                    }
                    String to = input.to();
                    if (!UNDEFINED.equals(to)) {
                        inputModel.setTo(to);
                    }
                    if (inputsModel == null) {
                        inputsModel = new V1InputsModel(knowledgeNamespace.uri());
                    }
                    inputsModel.addInput(inputModel);
View Full Code Here

                    String to = input.to();
                    if (!UNDEFINED.equals(to)) {
                        inputModel.setTo(to);
                    }
                    if (inputsModel == null) {
                        inputsModel = new V1InputsModel(knowledgeNamespace.uri());
                    }
                    inputsModel.addInput(inputModel);
                }
            }
        }
View Full Code Here

        if (listenerAnnotations == null || listenerAnnotations.length == 0) {
            return null;
        }
        ListenersModel listenersModel = new V1ListenersModel(knowledgeNamespace.uri());
        for (Listener listenerAnnotation : listenerAnnotations) {
            ListenerModel listenerModel = new V1ListenerModel(knowledgeNamespace.uri());
            listenerModel.setClazz(listenerAnnotation.value());
            listenersModel.addListener(listenerModel);
        }
        return listenersModel;
    }
View Full Code Here

TOP

Related Classes of org.switchyard.component.common.knowledge.config.model.v1.V1InputsModel

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.