Examples of LoggedRuntimeException


Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

    public BaseXPath createXPath(OMElement element, QName attributeName) {
        try {
            return org.apache.synapse.config.xml.SynapseXPathFactory.getSynapseXPath(element,
                    attributeName);
        } catch (JaxenException e) {
            throw new LoggedRuntimeException("Error creating XPath from omelement : " + element
                    + " with attribute : " + attributeName, e, log);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

        }
    }

    public BaseXPath createXPath(String xpath, Collection<OMNamespace> omNameSpaces) {
        if (xpath == null || "".equals(xpath)) {
            throw new LoggedRuntimeException("XPath expression is null or empty", log);
        }
        try {
            SynapseXPath synapseXPath = new SynapseXPath(xpath);
            for (OMNamespace omNamespace : omNameSpaces) {
                if (omNamespace != null) {
                    synapseXPath.addNamespace(omNamespace.getPrefix(), omNamespace.getNamespaceURI());
                }
            }
            return synapseXPath;
        } catch (JaxenException e) {
            throw new LoggedRuntimeException("Invalid XPapth expression : " +
                    xpath, e, log);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

                }
                return new ReturnValue(defaultValue);
            }
            return new ReturnValue(result, true);
        } catch (JaxenException e) {
            throw new LoggedRuntimeException("Error when evaluating XPath : " + xPath, e, log);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

        if (message instanceof MessageContext) {
            MessageContext messageContext = ((MessageContext) message);
            return new ReturnValue(messageContext.getEnvelope(), true);
        }
        throw new LoggedRuntimeException("Invalid context object, expected Synapse Message Context",
                log);
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

            Object result = mapper.getObjectFromOMNode((OMNode) tobeAdapted,new Properties());

            if (result instanceof Mediator) {
                return result;
            } else {
                throw new LoggedRuntimeException("Incompatible value for the sequence " +
                        result, log);
            }

        } else {
            throw new LoggedRuntimeException("Incompatible value for the sequence  " +
                    tobeAdapted, log);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

     * @return The XML representation of rule mediator   (OMElement)
     */
    public OMElement serializeSpecificMediator(Mediator m) {

        if (!(m instanceof RuleMediator)) {
            throw new LoggedRuntimeException("Invalid Mediator has passed to serializer", log);
        }
        RuleMediator ruleMediator = (RuleMediator) m;
        RuleMediatorDescription ruleMediatorDescription = ruleMediator.getRuleMediatorDescription();
        OMElement ruleElement =
                RuleMediatorDescriptionSerializer.serialize(ruleMediatorDescription,
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

        Object ruleScript = description.getRuleSource();
        Map<String, Object> properties = PropertyDescriptionEvaluator.evaluate(
                description.getCreationProperties());
        InputStream in = ObjectToStreamConverter.toInputStream(ruleScript, properties);
        if (in == null) {
            throw new LoggedRuntimeException("The input stream form rule script is null.",
                    log);
        }

        ResourceTypeDetectionStrategy strategy = new DefaultResourceTypeDetectionStrategy();
        ResourceType resourceType = strategy.getResourceType(properties);

        knowledgeBuilder.add(ResourceFactory.newInputStreamResource(in), resourceType);
        if (knowledgeBuilder.hasErrors()) {
            throw new LoggedRuntimeException("Error during creating rule set: " +
                    knowledgeBuilder.getErrors(), log);
        }

        Collection<KnowledgePackage> pkgs = knowledgeBuilder.getKnowledgePackages();
        knowledgeBase.addKnowledgePackages(pkgs);
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

            }
            StatefulKnowledgeSession ruleSession = knowledgeBase.newStatefulKnowledgeSession(
                    configuration, null);

            if (ruleSession == null) {
                throw new LoggedRuntimeException("The created stateful rule session is null", log);
            }
            return new DroolsStatefulSession(ruleSession, properties);
        } else {
            if (log.isDebugEnabled()) {
                log.debug("Using stateless rule session");
            }
            // create stateless rule session
            StatelessKnowledgeSession ruleSession =
                    knowledgeBase.newStatelessKnowledgeSession(configuration);

            if (ruleSession == null) {
                throw new LoggedRuntimeException("The created stateless rule session is null", log);
            }
            return new DroolsStatelessSession(ruleSession);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

        } else if (tobeAdapted instanceof OMElement) {
            OMElement omElement = (OMElement) tobeAdapted;
            if (PayloadHelper.MAPELT.equals(omElement.getQName())) {
                return new SimpleMapImpl(omElement);
            } else {
                throw new LoggedRuntimeException("Incompatible value for the map " + "Wrong QName" +
                        omElement.getQName() + " expected " + PayloadHelper.MAPELT, log);
            }
        } else {
            throw new LoggedRuntimeException("Incompatible value for the map " +
                    tobeAdapted, log);
        }
    }
View Full Code Here

Examples of org.wso2.carbon.rule.core.LoggedRuntimeException

                               Object result,
                               Object context,
                               MessageInterceptor messageInterceptor) {

        if (description == null) {
            throw new LoggedRuntimeException("Cannot find Resource description. " +
                    "Invalid Resource !!", log);
        }
        if (result == null) {
            return false;
        }
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.