Examples of MutableRefMetadata


Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        value.setStringValue(str);
        return value;
    }

    private RefMetadata createRef(ParserContext context, String id) {
        MutableRefMetadata idref = context.createMetadata(MutableRefMetadata.class);
        idref.setComponentId(id);
        return idref;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        m.setType(type);
        return m;
    }

    private static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata m = context.createMetadata(MutableRefMetadata.class);
        m.setComponentId(value);
        return m;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        m.setType(type);
        return m;
    }

    private static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata m = context.createMetadata(MutableRefMetadata.class);
        m.setComponentId(value);
        return m;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        v.setStringValue(value);
        return v;
    }

    public static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata r = context.createMetadata(MutableRefMetadata.class);
        r.setComponentId(value);
        return r;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        v.setStringValue(value);
        return v;
    }

    public static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata r = context.createMetadata(MutableRefMetadata.class);
        r.setComponentId(value);
        return r;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        m.setType(type);
        return m;
    }

    private static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata m = context.createMetadata(MutableRefMetadata.class);
        m.setComponentId(value);
        return m;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        m.setType(type);
        return m;
    }

    private static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata m = context.createMetadata(MutableRefMetadata.class);
        m.setComponentId(value);
        return m;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        classes.add(SSLContextParametersFactoryBean.class);
        return classes;
    }

    private RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata r = context.createMetadata(MutableRefMetadata.class);
        r.setComponentId(value);
        return r;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

        v.setStringValue(value);
        return v;
    }

    public static RefMetadata createRef(ParserContext context, String value) {
        MutableRefMetadata r = context.createMetadata(MutableRefMetadata.class);
        r.setComponentId(value);
        return r;
    }
View Full Code Here

Examples of org.apache.aries.blueprint.mutable.MutableRefMetadata

                componentMetadata.setId(kieLoggerElementParser.getId(context, loggerNode));
                kieLoggerElementParser.generateIdIfNeeded(context, componentMetadata);
                componentMetadata.setClassName(KieLoggerAdaptor.class.getName());
                context.getComponentDefinitionRegistry().registerComponentDefinition(componentMetadata);

                MutableRefMetadata refMetadata = context.createMetadata(MutableRefMetadata.class);
                refMetadata.setComponentId(componentMetadata.getId());
                collectionMetadata.addValue(refMetadata);
            }
        }

        NodeList fileLoggerList = element.getElementsByTagName(prefix+":fileLogger");
        if ( fileLoggerList != null && fileLoggerList.getLength() > 0){
            for (int i=0; i < fileLoggerList.getLength(); i++){
                Node loggerNode = fileLoggerList.item(i);
                MutableBeanMetadata componentMetadata = context.createMetadata(MutableBeanMetadata.class);
                String id = kieLoggerElementParser.getId(context, loggerNode);
                if ( id != null) {
                    componentMetadata.setId(id);
                }
                kieLoggerElementParser.generateIdIfNeeded(context, componentMetadata);
                context.getComponentDefinitionRegistry().registerComponentDefinition(componentMetadata);

                componentMetadata.setClassName(KieLoggerAdaptor.class.getName());

                String fileName = kieLoggerElementParser.getAttributeValue(loggerNode, LOGGER_ATTRIBUTE_FILE);
                if (StringUtils.isEmpty(LOGGER_ATTRIBUTE_FILE)){
                    throw new ComponentDefinitionException(LOGGER_ATTRIBUTE_FILE+" attribute is missing for logger ("+ kieLoggerElementParser.getId(context, element)+")");
                }
                fileName =  ExpressionUtils.resolveExpressionInPath(fileName);
                componentMetadata.addProperty("file", kieLoggerElementParser.createValue(context, fileName));

                String threaded = kieLoggerElementParser.getAttributeValue(loggerNode, LOGGER_ATTRIBUTE_THREADED);
                if (!StringUtils.isEmpty(LOGGER_ATTRIBUTE_FILE) && "true".equalsIgnoreCase(threaded)){
                    componentMetadata.addProperty("loggerType", kieLoggerElementParser.createValue(context, KieLoggerAdaptor.KNOWLEDGE_LOGGER_TYPE.LOGGER_TYPE_THREADED_FILE.toString()));
                    String interval = kieLoggerElementParser.getAttributeValue(loggerNode, LOGGER_ATTRIBUTE_INTERVAL);
                    if ( !StringUtils.isEmpty(interval)){
                        try{
                            int nInterval = Integer.parseInt(interval);
                            componentMetadata.addProperty("interval", kieLoggerElementParser.createValue(context, nInterval));
                        }catch (Exception e){
                            //should never happen, the XSD would prevent non-integers coming this far.
                        }
                    }
                    if (StringUtils.isEmpty(LOGGER_ATTRIBUTE_FILE)){
                        throw new ComponentDefinitionException(LOGGER_ATTRIBUTE_FILE+" attribute is missing for logger ("+ kieLoggerElementParser.getId(context, element)+")");
                    }

                } else{
                    componentMetadata.addProperty("loggerType", kieLoggerElementParser.createValue(context, KieLoggerAdaptor.KNOWLEDGE_LOGGER_TYPE.LOGGER_TYPE_FILE.toString()));
                }

                MutableRefMetadata refMetadata = context.createMetadata(MutableRefMetadata.class);
                refMetadata.setComponentId(componentMetadata.getId());
                collectionMetadata.addValue(refMetadata);
            }
        }
        return collectionMetadata;
    }
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.