Package org.wso2.carbon.rulecep.commons

Examples of org.wso2.carbon.rulecep.commons.ReturnValue


        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


        }

        SessionDescription sessionDescription = ruleMediatorDescription.getSessionDescription();

        if (registryKey != null) {
            ReturnValue returnValue = interceptor.extract(registryKey, synCtx, null);
            if (returnValue.getValue() == null) {
                handleException("RuleSet cannot be found for the registry key : " + registryKey,
                        synCtx);
            }
            if (returnValue.isFresh()) {
                synchronized (resourceLock) {
                    addRuleSet(returnValue.getValue(), sessionDescription);
                }
            }
            if (!added) {
                synchronized (resourceLock) {
                    if (!added) {
                        addRuleSet(returnValue.getValue(), sessionDescription);
                    }
                }
            }
        }
View Full Code Here

            MessageContext synCtx = (MessageContext) source;

            // On the first check the availability of the key in property bag
            Object result = synCtx.getProperty(key);
            if (result != null) {
                return new ReturnValue(result);

            //Then, it must be a entry key
            //reload the XML document from the registry
            boolean reLoad = false;
            Entry dp = synCtx.getConfiguration().getEntryDefinition(key);
            // if the key refers to a dynamic resource
            if (dp != null && dp.isDynamic()) {
                if (!dp.isCached() || dp.isExpired()) {
                    reLoad = true;
                }
            }
            if (reLoad) {
                // it is need to synchronized this to avoid recreation of the cachedValue by
                // the multiple threads
                synchronized (resourceLock) {
                    return new ReturnValue(synCtx.getEntry(key), true);
                }
            } else {
                return new ReturnValue(synCtx.getEntry(key), defaultValue != null);
                // recreation by the multiple threads
            }
        }
        return new ReturnValue(defaultValue);

    }
View Full Code Here

            if (result == null) {
                if (log.isDebugEnabled()) {
                    log.debug("Evaluation of the XPath :  " + xPath + " result in null," +
                            " returning given default value");
                }
                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

            MessageContext messageContext = ((MessageContext) message);
            OMElement returnElement = messageContext.getEnvelope().getBody().getFirstElement();
            if (returnElement == null) {
                returnElement = messageContext.getEnvelope().getBody();
            }
            return new ReturnValue(returnElement, true);
        }
        return null;
    }
View Full Code Here

    public ReturnValue extractEnvelope(Object message) {

        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

        String key = description.getKey();

        // if the key provides , then it should be a property key or entry key
        if (key != null) {
            // On the first check the availability of the key in property bag
            ReturnValue returnValue = messageInterceptor.extract(key, context, null);
            if (returnValue != null) {
                value = returnValue.getValue();
            }
        }
        if (value == null) {
            value = evaluateExpression(description, context, messageInterceptor);
            if (value == null) {
                ReturnValue returnValue = messageInterceptor.extractPayload(context);
                if (returnValue != null) {
                    value = returnValue.getValue();
                }
            }
        }
        return value;
    }
View Full Code Here

        Object targetNode = ResourceDescriptionEvaluator.evaluateExpression(description,
                context,
                messageInterceptor);

        if (targetNode == null) {
            ReturnValue returnValue = messageInterceptor.extractPayload(context);
            targetNode = returnValue.getValue();
        }

        if (value instanceof OMElement) {
            return false;
        }
View Full Code Here

        BaseXPath sourceExpression = description.getExpression();
        if (sourceExpression == null) {
            return null;
        }
        // evaluates the expression against source
        ReturnValue returnValue = messageInterceptor.extract(sourceExpression, context, null);
        Object o = returnValue.getValue();
        if (o instanceof OMNode) {
            return o;

        } else if (o instanceof List && !((List) o).isEmpty()) {
            Object nodeObject = ((List) o).get(0); // Always fetches *only* the first
View Full Code Here

            if (context == null) {
                throw new LoggedRuntimeException("Invalid property - a value cannot be found" +
                        " for property : " + name, log);
            }
            ReturnValue returnValue = messageInterceptor.extract(
                    propertyDescription.getExpression(),
                    context, value);
            value = returnValue.getValue();
        }

        if (value == null || "".equals(value)) {
            throw new LoggedRuntimeException("Invalid property - a value cannot be found " +
                    "for property : " + name, log);
View Full Code Here

TOP

Related Classes of org.wso2.carbon.rulecep.commons.ReturnValue

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.