Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void parse(final org.jboss.staxmapper.XMLExtendedStreamReader reader, final java.util.List<org.jboss.dmr.ModelNode> operations, org.jboss.dmr.ModelNode subsystemAddress) throws Exception
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        public virtual void parse(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode subsystemAddress)
        {
            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.PROCESS_ENGINES:
                {
                    parseProcessEngines(reader, operations, subsystemAddress);
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.JOB_EXECUTOR:
                {
                    parseJobExecutor(reader, operations, subsystemAddress);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parsePlugin(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> operations, org.jboss.dmr.ModelNode plugins) throws javax.xml.stream.XMLStreamException
        protected internal virtual void parsePlugin(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode plugins)
        {
            requireNoAttributes(reader);
            ModelNode plugin = new ModelNode();

            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.PLUGIN_CLASS:
                {
                    parseElement(SubsystemAttributeDefinitons.PLUGIN_CLASS, plugin, reader);
                    break;
                }

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

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

            plugins.add(plugin);
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parseProperties(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 parseProperties(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode parentAddress)
        {
            requireNoAttributes(reader);

            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.PROPERTY:
                {
                    string name  = reader.getAttributeValue(0);
                    string value = rawElementText(reader);

                    SubsystemAttributeDefinitons.PROPERTIES.parseAndAddParameterElement(name, value, parentAddress, reader);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }
Exemplo n.º 4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void parseProperties(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 parseProperties(XMLExtendedStreamReader reader, IList <ModelNode> list, ModelNode parentAddress)
        {
            if (!Element.PROPERTIES.LocalName.Equals(reader.LocalName))
            {
                throw unexpectedElement(reader);
            }

            requireNoAttributes(reader);

            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.PROPERTY:
                {
                    parseProperty(reader, list, parentAddress);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }
Exemplo n.º 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void parseJobExecutor(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 parseJobExecutor(XMLExtendedStreamReader reader, IList <ModelNode> list, ModelNode parentAddress)
        {
            if (!Element.JOB_EXECUTOR.LocalName.Equals(reader.LocalName))
            {
                throw unexpectedElement(reader);
            }

            // Add the 'add' operation for 'job-executor' parent
            ModelNode addJobExecutor = new ModelNode();

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

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

            list.Add(addJobExecutor);

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

                case START_ELEMENT:
                {
                    switch (Element.forName(reader.LocalName))
                    {
                    case JOB_AQUISITIONS:
                    {
                        parseJobAcquisitions(reader, list, addJobExecutor);
                        break;
                    }

                    case THREAD_POOL_NAME:
                    {
                        parseElement(SubsystemAttributeDefinitons.THREAD_POOL_NAME, reader, addJobExecutor);
                        break;
                    }

                    default:
                    {
                        throw unexpectedElement(reader);
                    }
                    }
                    break;
                }
                }
            }
        }
Exemplo n.º 6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parseAdditionalProcessEngineSettings(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> operations, org.jboss.dmr.ModelNode addProcessEngineOp) throws javax.xml.stream.XMLStreamException
        protected internal virtual void parseAdditionalProcessEngineSettings(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode addProcessEngineOp)
        {
            // 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.DATASOURCE:
                {
                    parseElement(SubsystemAttributeDefinitons.DATASOURCE, addProcessEngineOp, reader);
                    break;
                }

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

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

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

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.PLUGINS:
                {
                    parsePlugins(reader, operations, addProcessEngineOp);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// {@inheritDoc} </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void readElement(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> list) throws javax.xml.stream.XMLStreamException
        public override void readElement(XMLExtendedStreamReader reader, IList <ModelNode> list)
        {
            // Require no attributes
            ParseUtils.requireNoAttributes(reader);

            //Add the main subsystem 'add' operation
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.dmr.ModelNode subsystemAddress = new org.jboss.dmr.ModelNode();
            ModelNode subsystemAddress = new ModelNode();

            subsystemAddress.add(SUBSYSTEM, ModelConstants_Fields.SUBSYSTEM_NAME);
            subsystemAddress.protect();

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.dmr.ModelNode subsystemAdd = new org.jboss.dmr.ModelNode();
            ModelNode subsystemAdd = new ModelNode();

            subsystemAdd.get(OP).set(ADD);
            subsystemAdd.get(OP_ADDR).set(subsystemAddress);
            list.Add(subsystemAdd);

            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.PROCESS_ENGINES:
                {
                    parseProcessEngines(reader, list, subsystemAddress);
                    break;
                }

                case org.camunda.bpm.container.impl.jboss.extension.Element.InnerEnum.JOB_EXECUTOR:
                {
                    parseJobExecutor(reader, list, subsystemAddress);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }
Exemplo n.º 8
0
            /// <summary>
            /// {@inheritDoc}
            /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override public void readElement(org.jboss.staxmapper.XMLExtendedStreamReader reader, java.util.List<org.jboss.dmr.ModelNode> operations) throws javax.xml.stream.XMLStreamException
            public override void readElement(XMLExtendedStreamReader reader, IList <ModelNode> operations)
            {
                // Require no attributes
                ParseUtils.requireNoAttributes(reader);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.dmr.ModelNode subsystemAddress = new org.jboss.dmr.ModelNode();
                ModelNode subsystemAddress = new ModelNode();

                subsystemAddress.add(SUBSYSTEM, ModelConstants_Fields.SUBSYSTEM_NAME);
                subsystemAddress.protect();

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.dmr.ModelNode subsystemAdd = new org.jboss.dmr.ModelNode();
                ModelNode subsystemAdd = new ModelNode();

                subsystemAdd.get(OP).set(ADD);
                subsystemAdd.get(OP_ADDR).set(subsystemAddress);
                operations.Add(subsystemAdd);


                while (reader.hasNext() && !reader.EndElement)
                {
                    switch (reader.LocalName)
                    {
                    case SUBSYSTEM:
                    {
                        try
                        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final BpmPlatformParser1_1 parser = new BpmPlatformParser1_1();
                            BpmPlatformParser1_1 parser = new BpmPlatformParser1_1();
                            parser.parse(reader, operations, subsystemAddress);
                        }
                        catch (Exception e)
                        {
                            throw new XMLStreamException(e);
                        }
                    }
                    break;
                    }
                }
            }
Exemplo n.º 9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: private void parseJobAcquisitions(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 parseJobAcquisitions(XMLExtendedStreamReader reader, IList <ModelNode> list, ModelNode parentAddress)
        {
            if (!Element.JOB_AQUISITIONS.LocalName.Equals(reader.LocalName))
            {
                throw unexpectedElement(reader);
            }

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

                case START_ELEMENT:
                {
                    switch (Element.forName(reader.LocalName))
                    {
                    case JOB_AQUISITION:
                    {
                        parseJobAcquisition(reader, list, parentAddress);
                        break;
                    }

                    default:
                    {
                        throw unexpectedElement(reader);
                    }
                    }
                    break;
                }
                }
            }
        }
Exemplo n.º 10
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parseProcessEngines(final org.jboss.staxmapper.XMLExtendedStreamReader reader, final java.util.List<org.jboss.dmr.ModelNode> operations, final org.jboss.dmr.ModelNode parentAddress) throws javax.xml.stream.XMLStreamException, org.jboss.as.connector.util.ParserException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        protected internal virtual void parseProcessEngines(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode parentAddress)
        {
            IList <string> discoveredEngineNames = new List <string>();

            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.PROCESS_ENGINE:
                {
                    parseProcessEngine(reader, operations, parentAddress, discoveredEngineNames);
                    break;
                }

                default:
                {
                    throw unexpectedElement(reader);
                }
                }
            }
        }
Exemplo n.º 11
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;
                }
                }
            }
        }
Exemplo n.º 12
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void parseJobExecutor(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 parseJobExecutor(XMLExtendedStreamReader reader, IList <ModelNode> operations, ModelNode parentAddress)
        {
            // Add the 'add' operation for 'job-executor' parent
            ModelNode addJobExecutorOp = new ModelNode();

            addJobExecutorOp.get(OP).set(ADD);
            ModelNode jobExecutorAddress = parentAddress.clone();

            jobExecutorAddress.add(ModelConstants_Fields.JOB_EXECUTOR, ModelConstants_Fields.DEFAULT);
            addJobExecutorOp.get(OP_ADDR).set(jobExecutorAddress);

            operations.Add(addJobExecutorOp);

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

                case START_ELEMENT:
                {
                    switch (Element.forName(reader.LocalName))
                    {
                    case JOB_AQUISITIONS:
                    {
                        parseJobAcquisitions(reader, operations, addJobExecutorOp);
                        break;
                    }

                    case THREAD_POOL_NAME:
                    {
                        parseElement(SubsystemAttributeDefinitons.THREAD_POOL_NAME, addJobExecutorOp, reader);
                        break;
                    }

                    case CORE_THREADS:
                    {
                        parseElement(SubsystemAttributeDefinitons.CORE_THREADS, addJobExecutorOp, reader);
                        break;
                    }

                    case MAX_THREADS:
                    {
                        parseElement(SubsystemAttributeDefinitons.MAX_THREADS, addJobExecutorOp, reader);
                        break;
                    }

                    case QUEUE_LENGTH:
                    {
                        parseElement(SubsystemAttributeDefinitons.QUEUE_LENGTH, addJobExecutorOp, reader);
                        break;
                    }

                    case KEEPALIVE_TIME:
                    {
                        parseElement(SubsystemAttributeDefinitons.KEEPALIVE_TIME, addJobExecutorOp, reader);
                        break;
                    }

                    case ALLOW_CORE_TIMEOUT:
                    {
                        parseElement(SubsystemAttributeDefinitons.ALLOW_CORE_TIMEOUT, addJobExecutorOp, reader);
                        break;
                    }

                    default:
                    {
                        throw unexpectedElement(reader);
                    }
                    }
                    break;
                }
                }
            }
        }
Exemplo n.º 13
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;
                }
                }
            }
        }
Exemplo n.º 14
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);
                }
                }
            }
        }