Package edu.indiana.extreme.xbaya

Examples of edu.indiana.extreme.xbaya.XBayaRuntimeException


                            "Cannot connect ports with different types.");
                }

            } else {
                // Should not happen.
                throw new XBayaRuntimeException("edges.size(): " + edges.size());
            }
        }
    }
View Full Code Here


        if (kind == Kind.DATA_IN) {
            index = inputPorts.indexOf(port) % size;
        } else if (kind == Kind.DATA_OUT) {
            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of input "
                        + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of input "
                        + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " ("
                        + inputType2 + ") of " + getID()
                        + " must be same as the type of output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }
        } else if (port == outputPort) {
            // output -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " ("
                        + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }
            // output -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " ("
                        + inputType2 + ") of " + getID()
                        + " must be same as the type of input " + index + " ("
                        + outputType + ").";
                throw new GraphException(message);
            }
        } else {
            throw new XBayaRuntimeException();
        }
    }
View Full Code Here

        if (arrayDimension == 1) {
            String typeName = declareArrayType(schema, type, wsdl);
            type = new QName(this.typesNamespace.getName(), typeName);
        } else if (arrayDimension > 1) {
            // TODO
            throw new XBayaRuntimeException(
                    "multi-dimentional arrays are not supported yet.");
        }

        if (WSConstants.XSD_ANY_TYPE.equals(type) && componentPort != null) {
            XmlElement elementElement = componentPort.getElement();
View Full Code Here

            // Need to copy the whole schema because it might have different
            // targetNamespace.
            XmlElement newSchema = WSDLUtil.getSchema(serviceWSDL, paramType);
            if (newSchema == null) {
                // This should have been caught in WSComponent
                throw new XBayaRuntimeException(
                        "could not find definition for type " + paramType
                                + " in " + WSDLUtil.getWSDLQName(serviceWSDL));
            }
            this.definitions.getTypes().addChild(XMLUtil.deepClone(newSchema));
View Full Code Here

      XmlElement clonedElement = element.clone();
      clonedElement.setParent(null);
      return clonedElement;
    } catch (CloneNotSupportedException e) {
      // This should not happen because we don't put any special Objects.
      throw new XBayaRuntimeException(e);
    }
  }
View Full Code Here

          + error.getCursorLocation().xmlText());
      stringBuilder.append("Message:" + error.getMessage());
      stringBuilder.append("Location of invalid XML: "
          + error.getCursorLocation().xmlText());
    }
    throw new XBayaRuntimeException(stringBuilder.toString());
  }
View Full Code Here

     * @param edge
     *            The edge to add
     */
    protected void addEdge(EdgeImpl edge) {
        if (this.edges.contains(edge)) {
            throw new XBayaRuntimeException("The edge is already addes");
        } else {
            this.edges.add(edge);
        }
    }
View Full Code Here

            this.dialog = new JDialog((Frame) this.owner);
        } else if (this.owner instanceof Dialog) {
            this.dialog = new JDialog((Dialog) this.owner);
        } else {
            // This should not happen.
            throw new XBayaRuntimeException(
                    "The owner component was neither Frame or Dialog.");
        }
        this.dialog.setTitle(this.title);
        this.dialog.setModal(true);
        this.dialog.setResizable(true);
View Full Code Here

                if (!(fromType == null || fromType
                        .equals(WSConstants.XSD_ANY_TYPE))) {
                    toDataPort.copyType(fromDataPort);
                }
            } else {
                throw new XBayaRuntimeException();
            }
        }
    }
View Full Code Here

        if (kind == Kind.DATA_IN) {
            index = inputPorts.indexOf(port);
        } else if (kind == Kind.DATA_OUT) {
            index = outputPorts.indexOf(port);
        } else {
            throw new XBayaRuntimeException();
        }

        SystemDataPort inputPort = (SystemDataPort) inputPorts.get(index);
        SystemDataPort outputPort = (SystemDataPort) outputPorts.get(index);

        QName inputType = inputPort.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort) {
            // input -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port, -1);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                // XXX cannot parse array from WSDL.
                // String message = "The type of input " + index + " ("
                // + inputType + ") of " + getID()
                // + " must be same as the type of output " + index + " ("
                // + outputType + ").";
                // throw new GraphException(message);
            }

        } else if (port == outputPort) {
            // output -> input1
            if (inputType.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort.copyType(port, 1);
            } else if (inputType.equals(portType)) {
                // Do nothing.
            } else {
                // XXX cannot parse array from WSDL.
                // String message = "The type of input " + index + " ("
                // + inputType + ") of " + getID()
                // + " must be same as the type of output " + index + " ("
                // + outputType + ").";
                // throw new GraphException(message);
            }
        } else {
            throw new XBayaRuntimeException();
        }
    }
View Full Code Here

TOP

Related Classes of edu.indiana.extreme.xbaya.XBayaRuntimeException

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.