Package org.wso2.carbon.mediator.service

Examples of org.wso2.carbon.mediator.service.MediatorException


            }
        } */

        //pls use a function to find the closest activity to the flow start
        //as well as the closest activity to the flow end;
        SVGCoordinates myStartCoords = getStartIconExitArrowCoords();
        SVGCoordinates myExitCoords = getEndIconEntryArrowCoords();

        subGroup.appendChild(getArrowDefinition(doc, myStartCoords.getXLeft(), myStartCoords.getYTop(),
                myStartCoords.getXLeft(), (myStartCoords.getYTop() + 30), "Flow_Top", true));
        subGroup.appendChild(getArrowDefinition(doc, (myStartCoords.getXLeft() - dimensions.getWidth()/2 + getXSpacing()),
                (myStartCoords.getYTop() + 30), (myStartCoords.getXLeft() + dimensions.getWidth()/2 - getXSpacing()),
                (myStartCoords.getYTop() + 30), "Flow_TopH", true));
        subGroup.appendChild(getArrowDefinition(doc, (myStartCoords.getXLeft() - dimensions.getWidth()/2 + getXSpacing()),
                (myExitCoords.getYTop() - 20), (myStartCoords.getXLeft() + dimensions.getWidth()/2 - getXSpacing()),
                (myExitCoords.getYTop() - 20), "Flow_DownH", true));
        subGroup.appendChild(getArrowDefinition(doc, myExitCoords.getXLeft(), myExitCoords.getYTop() - 20,
                myExitCoords.getXLeft(), myExitCoords.getYTop(), "Flow_Top", false));

        return subGroup;
    }
View Full Code Here


            xLeft = getDimensions().getXLeft() + BOX_MARGIN;
            yTop = getDimensions().getYTop() + (getDimensions().getHeight() / 2);

        }

        SVGCoordinates coords = new SVGCoordinates(xLeft, yTop);

        return coords;
    }
View Full Code Here

    @Override
    public SVGDimension getDimensions() {
        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing();
            width += getXSpacing();
View Full Code Here

        if (dimensions == null) {
            int width = 0;
            int height = 0;
            dimensions = new org.wso2.carbon.bpel.ui.bpel2svg.SVGDimension(width, height);

            SVGDimension subActivityDim = null;
            org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface activity = null;
            Iterator<org.wso2.carbon.bpel.ui.bpel2svg.ActivityInterface> itr = getSubActivities().iterator();
            while (itr.hasNext()) {
                activity = itr.next();
                subActivityDim = activity.getDimensions();
                if (subActivityDim.getWidth() > width) {
                    width += subActivityDim.getWidth();
                }
                height += subActivityDim.getHeight();
            }

            height += getYSpacing() + getStartIconHeight() + (getYSpacing() / 2);
            width += getXSpacing();
View Full Code Here

            // Use KeySerializer to serialize Key
            ValueSerializer keySerializer =  new ValueSerializer();
            keySerializer.serializeValue(xsltKey, XMLConfigConstants.KEY, xslt);

        } else {
            throw new MediatorException("Invalid XSLT mediator. XSLT registry key is required");
        }
        saveTracingState(xslt, this);

        if (source != null) {
            SynapseXPathSerializer.serializeXPath(source, xslt, "source");
        }
        if (targetPropertyName != null) {
            xslt.addAttribute(fac.createOMAttribute(
                "target", nullNS, targetPropertyName));
        }
        serializeMediatorProperties(xslt, properties, PROP_Q);
        if (!transformerFactoryFeatures.isEmpty()) {
            for (MediatorProperty mp : transformerFactoryFeatures) {
                OMElement prop = fac.createOMElement("feature", synNS, xslt);
                if (mp.getName() != null) {
                    prop.addAttribute(fac.createOMAttribute("name", nullNS, mp.getName()));
                } else {
                    throw new MediatorException("The Feature name is missing");
                }
                if (mp.getValue() != null) {
                    prop.addAttribute(fac.createOMAttribute("value", nullNS, mp.getValue()));
                else {
                    throw new MediatorException("The Feature value is missing");
                }
            }
        }
        serializeMediatorProperties(xslt, transformerFactoryAttributes, ATTRIBUTE_Q);
View Full Code Here

        if (attXslt != null) {
            //Use KeyFactory to create Key
            ValueFactory keyFactory = new ValueFactory();
            xsltKey = keyFactory.createValue(XMLConfigConstants.KEY, elem);
        } else {
            throw new MediatorException("The 'key' attribute is required for the XSLT mediator");
        }

        if (attSource != null) {
            try {
                source = SynapseXPathFactory.getSynapseXPath(elem, ATT_SOURCE);
            } catch (JaxenException e) {
                throw new MediatorException("Invalid XPath specified for the source attribute : " +
                    attSource.getAttributeValue());
            }
        }

        if (attTarget != null) {
            targetPropertyName = attTarget.getAttributeValue();
        }   
   
        // after successfully creating the mediator
        // set its common attributes such as tracing etc
        processAuditStatus(this, elem);
        // set the features
        for (Map.Entry<String,String> entry : collectNameValuePairs(elem, FEATURE_Q).entrySet()) {
            String value = entry.getValue();
            boolean isFeatureEnabled;
            if ("true".equals(value)) {
                isFeatureEnabled = true;
            } else if ("false".equals(value)) {
                isFeatureEnabled = false;
            } else {
                throw new MediatorException("The feature must have value true or false");
            }
            addFeature(entry.getKey(), isFeatureEnabled);
        }
        for (Map.Entry<String,String> entry : collectNameValuePairs(elem, ATTRIBUTE_Q).entrySet()) {
            addAttribute(entry.getKey(), entry.getValue());
View Full Code Here

    public QName getTagQName() {
    return PAYPAL_Q;
  }

  protected void handleException(String exceptionMsg) {
    throw new MediatorException(exceptionMsg);
  }
View Full Code Here

        return parameterElem;
    }

    protected void handleException(String exceptionMsg) {
        throw new MediatorException(exceptionMsg);
    }
View Full Code Here

                            this.diskCacheSize = Integer.parseInt(sizeAttr.getAttributeValue());
                        } else {
                            this.diskCacheSize = DEFAULT_DISK_CACHE_SIZE;
                        }
                    } else {
                        throw new MediatorException("unknown implementation type for the Cache mediator");
                    }
                }
            }
        }
    }
View Full Code Here

            return true;
        } else if (CachingConstants.SCOPE_PER_MEDIATOR.equals(scope)) {
            if (id != null) {
                return true;
            } else {
                throw new MediatorException("Id is required for a cache wirth scope : " + scope);               
            }
        } else if (CachingConstants.SCOPE_DISTRIBUTED.equals(scope)) {
            throw new MediatorException("Scope distributed is not supported yet by the Cache mediator");
        } else {
            throw new MediatorException("Unknown scope " + scope + " for the Cache mediator");
        }
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.mediator.service.MediatorException

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.