Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parseJobAcquisition(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> operations, org.jboss.dmr.ModelNode parentAddress) throws javax.xml.stream.XMLStreamException
        protected internal virtual void parseJobAcquisition(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode parentAddress)
        {
            string acquisitionName = null;

            // Add the 'add' operation for each 'job-acquisition' child
            ModelNode addJobAcquisitionOp = new ModelNode();

            addJobAcquisitionOp.get(OP).set(ADD);

            for (int i = 0; i < reader.AttributeCount; i++)
            {
                Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
                switch (attribute.innerEnumValue)
                {
                case org.camunda.bpm.container.impl.jboss.extension.Attribute.InnerEnum.NAME:
                {
                    acquisitionName = rawAttributeText(reader, NAME.LocalName);
                    if (!string.ReferenceEquals(acquisitionName, null) && !acquisitionName.Equals("null"))
                    {
                        SubsystemAttributeDefinitons.NAME.parseAndSetParameter(acquisitionName, addJobAcquisitionOp, reader);
                    }
                    else
                    {
                        throw missingRequiredElement(reader, Collections.singleton(NAME.LocalName));
                    }
                    break;
                }

                default:
                    throw unexpectedAttribute(reader, i);
                }
            }

            ModelNode jobAcquisitionAddress = parentAddress.get(OP_ADDR).clone();

            jobAcquisitionAddress.add(ModelConstants_Fields.JOB_ACQUISITIONS, acquisitionName);
            addJobAcquisitionOp.get(OP_ADDR).set(jobAcquisitionAddress);

            operations.Add(addJobAcquisitionOp);

            // iterate deeper
            while (reader.hasNext())
            {
                switch (reader.nextTag())
                {
                case END_ELEMENT:
                {
                    if (Element.forName(reader.LocalName) == Element.JOB_AQUISITION)
                    {
                        // should mean we're done, so ignore it.
                        return;
                    }
                }
                    goto case START_ELEMENT;

                case START_ELEMENT:
                {
                    switch (Element.forName(reader.LocalName))
                    {
                    case PROPERTIES:
                    {
                        parseProperties(reader, operations, addJobAcquisitionOp);
                        break;
                    }

                    case ACQUISITION_STRATEGY:
                    {
                        parseElement(SubsystemAttributeDefinitons.ACQUISITION_STRATEGY, addJobAcquisitionOp, reader);
                        break;
                    }

                    default:
                    {
                        throw unexpectedElement(reader);
                    }
                    }
                    break;
                }
                }
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void parseJobAcquisition(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> list, org.jboss.dmr.ModelNode parentAddress) throws javax.xml.stream.XMLStreamException
        private void parseJobAcquisition(XMLExtendedStreamReader reader, IList <ModelNode> list, ModelNode parentAddress)
        {
            if (!Element.JOB_AQUISITION.LocalName.Equals(reader.LocalName))
            {
                throw unexpectedElement(reader);
            }

            string acquisitionName = null;

            for (int i = 0; i < reader.AttributeCount; i++)
            {
                string attr = reader.getAttributeLocalName(i);
                if (Attribute.forName(attr).Equals(Attribute.NAME))
                {
                    acquisitionName = reader.getAttributeValue(i).ToString();
                }
                else
                {
                    throw unexpectedAttribute(reader, i);
                }
            }

            if ("null".Equals(acquisitionName))
            {
                throw missingRequiredElement(reader, Collections.singleton(Attribute.NAME.LocalName));
            }

            // Add the 'add' operation for each 'job-acquisition' child
            ModelNode addJobAcquisition = new ModelNode();

            addJobAcquisition.get(OP).set(ADD);
            PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, ModelConstants_Fields.SUBSYSTEM_NAME), PathElement.pathElement(Element.JOB_EXECUTOR.LocalName, ModelConstants_Fields.DEFAULT), PathElement.pathElement(Element.JOB_AQUISITIONS.LocalName, acquisitionName));

            addJobAcquisition.get(OP_ADDR).set(addr.toModelNode());

            addJobAcquisition.get(Attribute.NAME.LocalName).set(acquisitionName);

            list.Add(addJobAcquisition);

            // iterate deeper
            while (reader.hasNext())
            {
                switch (reader.nextTag())
                {
                case END_ELEMENT:
                {
                    if (Element.forName(reader.LocalName) == Element.JOB_AQUISITION)
                    {
                        // should mean we're done, so ignore it.
                        return;
                    }
                }
                    goto case START_ELEMENT;

                case START_ELEMENT:
                {
                    switch (Element.forName(reader.LocalName))
                    {
                    case PROPERTIES:
                    {
                        parseProperties(reader, list, addJobAcquisition);
                        break;
                    }

                    case ACQUISITION_STRATEGY:
                    {
                        parseElement(SubsystemAttributeDefinitons.ACQUISITION_STRATEGY, reader, addJobAcquisition);
                        break;
                    }

                    default:
                    {
                        throw unexpectedElement(reader);
                    }
                    }
                    break;
                }
                }
            }
        }
Пример #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parseProcessEngine(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> operations, org.jboss.dmr.ModelNode parentAddress, java.util.List<String> discoveredEngineNames) throws javax.xml.stream.XMLStreamException, org.jboss.as.connector.util.ParserException
        protected internal virtual void parseProcessEngine(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode parentAddress, IList <string> discoveredEngineNames)
        {
            string engineName = null;

            //Add the 'add' operation for each 'process-engine' child
            ModelNode addProcessEngineOp = new ModelNode();

            addProcessEngineOp.get(OP).set(ADD);

            for (int i = 0; i < reader.AttributeCount; i++)
            {
                Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
                switch (attribute.innerEnumValue)
                {
                case org.camunda.bpm.container.impl.jboss.extension.Attribute.InnerEnum.NAME:
                {
                    engineName = rawAttributeText(reader, NAME.LocalName);
                    if (!string.ReferenceEquals(engineName, null) && !engineName.Equals("null"))
                    {
                        SubsystemAttributeDefinitons.NAME.parseAndSetParameter(engineName, addProcessEngineOp, reader);
                    }
                    else
                    {
                        throw missingRequiredElement(reader, Collections.singleton(NAME.LocalName));
                    }
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Attribute.InnerEnum.DEFAULT:
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String value = rawAttributeText(reader, DEFAULT.getLocalName());
                    string value = rawAttributeText(reader, DEFAULT.LocalName);
                    if (!string.ReferenceEquals(value, null))
                    {
                        SubsystemAttributeDefinitons.DEFAULT.parseAndSetParameter(value, addProcessEngineOp, reader);
                    }
                    break;
                }

                default:
                    throw unexpectedAttribute(reader, i);
                }
            }

            ModelNode processEngineAddress = parentAddress.clone();

            processEngineAddress.add(ModelConstants_Fields.PROCESS_ENGINES, engineName);
            addProcessEngineOp.get(OP_ADDR).set(processEngineAddress);

            if (discoveredEngineNames.Contains(engineName))
            {
                throw new ProcessEngineException("A process engine with name '" + engineName + "' already exists. The process engine name must be unique.");
            }
            else
            {
                discoveredEngineNames.Add(engineName);
            }

            operations.Add(addProcessEngineOp);

            parseAdditionalProcessEngineSettings(reader, operations, addProcessEngineOp);
        }
Пример #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void parseProcessEngine(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> list, org.jboss.dmr.ModelNode parentAddress, java.util.List<String> discoveredEngineNames) throws javax.xml.stream.XMLStreamException
        private void parseProcessEngine(XMLExtendedStreamReader reader, IList <ModelNode> list, ModelNode parentAddress, IList <string> discoveredEngineNames)
        {
            if (!Element.PROCESS_ENGINE.LocalName.Equals(reader.LocalName))
            {
                throw unexpectedElement(reader);
            }

            ModelNode addProcessEngine = new ModelNode();
            string    engineName       = null;

            for (int i = 0; i < reader.AttributeCount; i++)
            {
                string attr = reader.getAttributeLocalName(i);
                if (Attribute.forName(attr).Equals(Attribute.NAME))
                {
                    engineName = reader.getAttributeValue(i).ToString();
                }
                else if (Attribute.forName(attr).Equals(Attribute.DEFAULT))
                {
                    SubsystemAttributeDefinitons.DEFAULT.parseAndSetParameter(reader.getAttributeValue(i), addProcessEngine, reader);
                }
                else
                {
                    throw unexpectedAttribute(reader, i);
                }
            }

            if ("null".Equals(engineName))
            {
                throw missingRequiredElement(reader, Collections.singleton(Attribute.NAME.LocalName));
            }

            //Add the 'add' operation for each 'process-engine' child
            addProcessEngine.get(OP).set(ModelDescriptionConstants.ADD);
            PathAddress addr = PathAddress.pathAddress(PathElement.pathElement(SUBSYSTEM, ModelConstants_Fields.SUBSYSTEM_NAME), PathElement.pathElement(Element.PROCESS_ENGINES.LocalName, engineName));

            addProcessEngine.get(OP_ADDR).set(addr.toModelNode());

            addProcessEngine.get(Attribute.NAME.LocalName).set(engineName);

            if (discoveredEngineNames.Contains(engineName))
            {
                throw new ProcessEngineException("A process engine with name '" + engineName + "' already exists. The process engine name must be unique.");
            }
            else
            {
                discoveredEngineNames.Add(engineName);
            }

            list.Add(addProcessEngine);

            // iterate deeper
            while (reader.hasNext() && reader.nextTag() != END_ELEMENT)
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final Element element = Element.forName(reader.getLocalName());
                Element element = Element.forName(reader.LocalName);
                switch (element.innerEnumValue)
                {
                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.PLUGINS:
                {
                    parsePlugins(reader, list, addProcessEngine);
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.PROPERTIES:
                {
                    parseProperties(reader, list, addProcessEngine);
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.DATASOURCE:
                {
                    parseElement(SubsystemAttributeDefinitons.DATASOURCE, reader, addProcessEngine);
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.HISTORY_LEVEL:
                {
                    parseElement(SubsystemAttributeDefinitons.HISTORY_LEVEL, reader, addProcessEngine);
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.CONFIGURATION:
                {
                    parseElement(SubsystemAttributeDefinitons.CONFIGURATION, reader, addProcessEngine);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }