<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns="http://www.springframework.org/schema/integration/jmx" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
			xmlns:beans="http://www.springframework.org/schema/beans"
			xmlns:tool="http://www.springframework.org/schema/tool"
			xmlns:integration="http://www.springframework.org/schema/integration"
			targetNamespace="http://www.springframework.org/schema/integration/jmx"
			elementFormDefault="qualified">

	<xsd:import namespace="http://www.springframework.org/schema/beans"/>
	<xsd:import namespace="http://www.springframework.org/schema/tool"/>
	<xsd:import namespace="http://www.springframework.org/schema/integration"
				schemaLocation="https://www.springframework.org/schema/integration/spring-integration.xsd"/>

	<xsd:annotation>
		<xsd:documentation><![CDATA[
	Defines the configuration elements for Spring Integration's JMX adapters.
		]]></xsd:documentation>
	</xsd:annotation>

	<xsd:element name="attribute-polling-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
				Defines a Polling Channel Adapter for the
				'org.springframework.integration.jmx.AttributePollingMessageSource'
				that polls for JMX attribute values.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="adapterType">
					<xsd:sequence minOccurs="0" maxOccurs="1">
						<xsd:element ref="integration:poller"/>
					</xsd:sequence>
					<xsd:attribute name="attribute-name" type="xsd:string" use="required"/>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="tree-polling-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
				Defines a Polling Channel Adapter for the
				'org.springframework.integration.jmx.MBeanTreePollingMessageSource' that polls for JMX MBeans.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="treeType">
					<xsd:sequence minOccurs="0" maxOccurs="1">
						<xsd:choice minOccurs="0" maxOccurs="2">
							<xsd:element ref="integration:poller"/>
							<xsd:element ref="beans:bean">
								<xsd:annotation>
									<xsd:appinfo>
										<tool:annotation kind="ref">
											<tool:expected-type
													type="org.springframework.integration.jmx.MBeanObjectConverter"/>
										</tool:annotation>
									</xsd:appinfo>
								</xsd:annotation>
							</xsd:element>
						</xsd:choice>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="operation-invoking-outbound-gateway">
		<xsd:annotation>
			<xsd:documentation>
				Configures a Consumer Endpoint for the
				'org.springframework.integration.jmx.OperationInvokingMessageHandler'
				which allows for Message-driven invocation of managed operations that
				return values.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="operationInvokingType">
					<xsd:all>
						<xsd:element ref="integration:poller" minOccurs="0" maxOccurs="1"/>
						<xsd:element name="transactional" type="integration:transactionalType" minOccurs="0"
									 maxOccurs="1"/>
						<xsd:element name="request-handler-advice-chain" type="integration:handlerAdviceChainType"
									 minOccurs="0" maxOccurs="1"/>
					</xsd:all>
					<xsd:attribute name="request-channel" type="xsd:string"/>
					<xsd:attribute name="reply-channel" type="xsd:string" use="optional"/>
					<xsd:attribute name="requires-reply" type="xsd:string" use="optional" default="true">
						<xsd:annotation>
							<xsd:documentation>
								Specify whether this outbound gateway must return a non-null value. This value is
								'true' by default, and ReplyRequiredException will be thrown when
								the underlying service returns a null value.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="operation-invoking-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
				Configures a Consumer Endpoint for the
				'org.springframework.integration.jmx.OperationInvokingMessageHandler' for invoking JMX operations
				without waiting for results.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="operationInvokingType">
					<xsd:all>
						<xsd:element ref="integration:poller" minOccurs="0" maxOccurs="1"/>
						<xsd:element name="request-handler-advice-chain" type="integration:handlerAdviceChainType"
									 minOccurs="0" maxOccurs="1"/>
					</xsd:all>
					<xsd:attribute name="channel" type="xsd:string" use="optional"/>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="notification-listening-channel-adapter">
		<xsd:annotation>
			<xsd:documentation><![CDATA[
				Defines a Message Producing Endpoint for the
				'org.springframework.integration.jmx.NotificationListeningMessageProducer'
				that listens for JMX notifications. The 'object-name'
				attribute on this endpoint can contain an ObjectName pattern and the MBeanServer will
				be queried for MBeans with ObjectNames matching the pattern. In addition, it can contain
				a SpEL expression that references a <util:list/> of ObjectNames or ObjectName patterns.
			]]></xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="adapterType">
					<xsd:attribute name="notification-filter" type="xsd:string" use="optional"/>
					<xsd:attribute name="handback" type="xsd:string" use="optional"/>
					<xsd:attribute name="send-timeout" type="xsd:string" use="optional"/>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="notification-publishing-channel-adapter">
		<xsd:annotation>
			<xsd:documentation>
				Configures a Consumer Endpoint for the
				'org.springframework.integration.jmx.NotificationPublishingMessageHandler' that publishes JMX
				notifications.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="adapterType">
					<xsd:all>
						<xsd:element ref="integration:poller" minOccurs="0" maxOccurs="1"/>
						<xsd:element name="request-handler-advice-chain" type="integration:handlerAdviceChainType"
									 minOccurs="0" maxOccurs="1"/>
					</xsd:all>
					<xsd:attribute name="default-notification-type" type="xsd:string" use="optional"/>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name="mbean-export">
		<xsd:annotation>
			<xsd:documentation>
				Defines a 'org.springframework.integration.monitor.IntegrationMBeanExporter' that exports Message
				Channels and Endpoints as MBeans.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="mbeanServerIdentifierType">
					<xsd:attribute name="default-domain" use="optional">
						<xsd:annotation>
							<xsd:documentation>
								The domain name for the MBeans exported by this Exporter.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="object-name-static-properties" use="optional">
						<xsd:annotation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type type="java.util.Properties"/>
								</tool:annotation>
							</xsd:appinfo>
							<xsd:documentation>
								Static object properties to be used for this domain. These properties are appended to
								the ObjectName of all MBeans registered by this component.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="managed-components" use="optional">
						<xsd:annotation>
							<xsd:documentation>
								Comma separated list of simple patterns for component names to register (defaults to
								'*').
								The pattern is applied to all components before they are registered, looking for a match
								on
								the 'name' property of the ObjectName. A MessageChannel and a MessageHandler (for
								instance)
								can share a name because they have a different type, so in that case they would either
								both
								be included or both excluded. Since version 4.2, a leading '!' negates the pattern match
								('!foo*' means don't export components where the name matches the pattern 'foo*').
								For components with names that match multiple patterns, the first pattern wins.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
					<xsd:attribute name="object-naming-strategy" use="optional">
						<xsd:annotation>
							<xsd:appinfo>
								<tool:annotation kind="ref">
									<tool:expected-type
											type="org.springframework.jmx.export.naming.ObjectNamingStrategy"/>
								</tool:annotation>
							</xsd:appinfo>
							<xsd:documentation>
								An ObjectNamingStrategy to generate the MBean's ObjectName. See the reference
								documentation
								for details of the default ObjectName. Also see 'object-name-static-properties'.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:attribute>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="treeType">
		<xsd:annotation>
			<xsd:documentation>
				Defines inbound operation invoking type
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="mbeanServerIdentifierType">
				<xsd:attribute name="channel" type="xsd:string"/>
				<xsd:attribute name="query-name" type="xsd:string" use="optional">
					<xsd:annotation>
						<xsd:documentation>
							A string to be parsed into an ObjectName object. If this
							attribute is specified you cannot specify `query-name-ref`.
						</xsd:documentation>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attribute name="query-name-ref" type="xsd:string" use="optional">
					<xsd:annotation>
						<xsd:documentation>
							A reference to an ObjectName instance. If this
							attribute is specified you cannot specify `query-name`.
						</xsd:documentation>
						<xsd:appinfo>
							<tool:annotation>
								<tool:expected-type type="javax.management.ObjectName"/>
							</tool:annotation>
						</xsd:appinfo>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attribute name="query-expression" type="xsd:string" use="optional">
					<xsd:annotation>
						<xsd:documentation>
							A string to be parsed into a QueryExp object. If this
							attribute is specified you cannot specify `query-expression-ref`.
						</xsd:documentation>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attribute name="query-expression-ref" type="xsd:string" use="optional">
					<xsd:annotation>
						<xsd:documentation>
							A reference to a QueryExp instance. If this
							attribute is specified you cannot specify `query-expression`.
						</xsd:documentation>
						<xsd:appinfo>
							<tool:annotation>
								<tool:expected-type type="javax.management.QueryExp"/>
							</tool:annotation>
						</xsd:appinfo>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attribute name="converter" type="xsd:string" use="optional">
					<xsd:annotation>
						<xsd:documentation>
							A reference to an MBeanObjectConverter.
						</xsd:documentation>
						<xsd:appinfo>
							<tool:annotation>
								<tool:expected-type type="org.springframework.integration.jmx.MBeanObjectConverter"/>
							</tool:annotation>
						</xsd:appinfo>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attributeGroup ref="integration:smartLifeCycleAttributeGroup"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="adapterType">
		<xsd:annotation>
			<xsd:documentation>
				Defines inbound operation invoking type
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="mbeanServerIdentifierType">
				<xsd:attribute name="channel" type="xsd:string"/>
				<xsd:attribute name="object-name" type="xsd:string" use="required"/>
				<xsd:attributeGroup ref="integration:smartLifeCycleAttributeGroup"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="operationInvokingType">
		<xsd:annotation>
			<xsd:documentation>
				Defines outbound operation invoking type
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexContent>
			<xsd:extension base="mbeanServerIdentifierType">
				<xsd:attribute name="object-name" type="xsd:string"/>
				<xsd:attribute name="operation-name" type="xsd:string"/>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="mbeanServerIdentifierType">
		<xsd:attribute name="id" type="xsd:string" use="optional"/>
		<xsd:attribute name="server" type="xsd:string" default="mbeanServer">
			<xsd:annotation>
				<xsd:documentation>
					Defines the name of the MBeanServer bean to connect to.
				</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>

</xsd:schema>
