Package eu.admire.dispel.parser.types

Examples of eu.admire.dispel.parser.types.ProcessingElementType


              return;
            }

            if (reg.getType() == DispelObjectType.PROCESSING_ELEMENT_TYPE)
            {
                ProcessingElementType peType = (ProcessingElementType)entry.getValue().getObject();
                if (peType.getImplementation() != null)
                {
                    LOG.debug("Writing registered composite processing element " + entry.getKey());
                    Graph component = GraphUtilities.getConnectedComponent(
                            peType.getImplementation());
                    String image =
                        convertToImage(component, variables);
                    mRegistered.put(reg.name, image);
                }
                else
                {
                    LOG.debug("Registering processing element type " + entry.getKey());
                    StringBuilder pe = new StringBuilder();
                    pe.append("Type ");
                    pe.append(reg.name);
                    if (peType.getDescriptor().getSuperType() != null
                            && !peType.getDescriptor().getSuperType().isEmpty())
                    {
                        pe.append(" is PE<");
                        pe.append(peType.getDescriptor().getSuperType().iterator().next());
                        pe.append(">;");
                    }
                    else
                    {
                        pe.append(" is PE(<");
                        for (ProcessingElementInputDescriptor input : peType.getDescriptor().getInputs())
                        {
                            pe.append("Connection ");
                            if (input.getIsDataSourceInput())
                            {
                                pe.append("locator ");
                            }
                            pe.append(input.getName());
                            pe.append("; ");
                        }
                        if (!peType.getDescriptor().getInputs().isEmpty())
                        {
                            pe.delete(pe.length()-2, pe.length());
                        }
                        pe.append("> => <");
                        for (ProcessingElementOutputDescriptor output : peType.getDescriptor().getOutputs())
                        {
                            pe.append("Connection ");
                            pe.append(output.getName());
                            pe.append("; ");
                        }
                        if (!peType.getDescriptor().getOutputs().isEmpty())
                        {
                            pe.delete(pe.length()-2, pe.length());
                        }
                        pe.append(">);");
                    }
View Full Code Here


        throws UnknownTypeException
    {
        Type type = mExecutionState.getUsedProcessingElements().getType(text);
        if (type instanceof ProcessingElementType)
        {
            ProcessingElementType used = (ProcessingElementType) type;
            ProcessingElementType peType =
                new ProcessingElementType(used.getImplementation());
            peType.setName(used.getName());
            mDescriptor = new SimpleProcessingElementDescriptor(
                    type.getName(),
                    TypeUtilities.cloneDescriptor(
                            ((ProcessingElementType)type).getDescriptor()),
                    null);
            peType.setDescriptor(mDescriptor);
            mType = peType;
        }
    }
View Full Code Here

                "with lockstep(source, vectors);");
        TestCase.assertNull(mGraphBuilder.getError());
        Variable var =
            builder.getDispelExecutionState().getVariables().get("DataProjector");
        TestCase.assertTrue(var.getValue() instanceof ProcessingElementType);
        ProcessingElementType pe = (ProcessingElementType) var.getValue();
        TestCase.assertEquals(1, pe.getAnnotationKeys().size());
        Object annotation = pe.getAnnotation(AnnotationKeys.ASSERTION_EXPRESSIONS);
        TestCase.assertTrue(annotation instanceof List<?>);
        TestCase.assertEquals(1, ((List<?>)annotation).size());
        TestCase.assertTrue(((List<?>)annotation).get(0) instanceof Function);
    }
View Full Code Here

            mProperty = id.getProperty();
            mIndices = id.getIndices();
            break;
        case CREATE_PE:
            CreatePETypeStrategy create = (CreatePETypeStrategy)strategy;
            ProcessingElementType pe = create.getPE();
            mVariable.setValue(pe);
            String qName = mExecutionState.getNamespaceManager().resolve(mName);
            mExecutionState.getUsedProcessingElements().registerType(qName, pe);
            break;
        case ARRAY:
View Full Code Here

      {
          throw new UnregisteredUsedObjectException(name);
      }
      if (object.getType() == DispelObjectType.PROCESSING_ELEMENT_TYPE)
      {
          ProcessingElementType pe = new ProcessingElementType(name);
          pe.setDescriptor((ProcessingElementDescriptor)object.metadata);
          executionState.getUsedProcessingElements().registerType(name, pe);
          // processing element implementations are parsed later
          // for now register the PE name as a variable
          try
            {
View Full Code Here

                    "pes[0] = new SubPE; " +
                    "}");
        assertNull(mError);
        Variable var = builder.getDispelExecutionState().getVariables().get("SubPE");
        assertNotNull(var);
        ProcessingElementType pe = (ProcessingElementType)var.getValue();
        assertTrue(pe.getDescriptor().getSuperType().contains("eu.admire.MyPE"));
        var = builder.getDispelExecutionState().getVariables().get("pes");
        assertNotNull(var);
        Object value = var.getValue(Arrays.asList(0));
        assertTrue(value instanceof CompositeProcessingElement);
        assertNotNull(((CompositeProcessingElement)value).getElements());
View Full Code Here

        assertNull(mError);
        assertTrue(!registered.isEmpty());
        RegisteredObject reg = registered.get("eu.admire.ConverterPE");
        assertNotNull(reg);
        assertTrue(reg.getObject() instanceof ProcessingElementType);
        ProcessingElementType converter = (ProcessingElementType)reg.getObject();
        assertTrue(AnySType.INSTANCE ==
            converter.getDescriptor().getInput("input").getSType());
        assertTrue(AnySType.INSTANCE ==
            converter.getDescriptor().getOutput("output").getSType());
    }
View Full Code Here

        ProcessingElementInputDescriptor inp = new ProcessingElementInputDescriptor("inputs");
        ProcessingElementDescriptor desc =
            new SimpleProcessingElementDescriptor(Arrays.asList(inp),
                    Arrays.<ProcessingElementOutputDescriptor>asList(),
                    null);
        ProcessingElementType peType = new ProcessingElementType("uk.org.ogsadai.ListConcatenate");
        peType.setDescriptor(desc);
        mRegistry.registerProcessingElement(peType);
        mRegistry.registerProcessingElement("eu.admire.madeup.DuplicatePruner");
        runDISPELFromFile(PATH + "ltype_example2.dispel");
        assertNull(mError);
    }
View Full Code Here

            new CompositeProcessingElement(null, graph.getNodes());
        composite.setInputs(mInputs.getInputs());
        composite.setOutputs(mOutputs.getOutputs());
        ProcessingElementDescriptor descriptor = getDescriptor();
        composite.setDescriptor(descriptor);
        ProcessingElementType type = new ProcessingElementType(composite);
        type.setDescriptor(descriptor);
        return type;
    }
View Full Code Here

            }
            break;
        case GENERIC_PE:
        {
            ProcessingElementTypeType type = ((PETypeStrategy)strategy).getPEType();
            mPE = new ProcessingElementType();
            mPE.setDescriptor(type.getDescriptor());
            mPE.setName(qualifiedName);
            mType = type;
            mExecutionState.getVariables().put(mName, new Variable(type, mPE));
            mExecutionState.getUsedProcessingElements().registerType(qualifiedName, mPE);
View Full Code Here

TOP

Related Classes of eu.admire.dispel.parser.types.ProcessingElementType

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.