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

	<xsd:include
			schemaLocation="https://www.springframework.org/schema/integration/scripting/spring-integration-scripting-core.xsd"
	/>

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

	<xsd:element name="script" type="GroovyScript">
		<xsd:annotation>
			<xsd:documentation>
				Configures an inner bean
				('org.springframework.integration.groovy.GroovyScriptExecutingMessageProcessor')
				that will generate a Groovy Script.
			</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:complexType name="GroovyScript">
		<xsd:complexContent>
			<xsd:extension base="ScriptType">
				<xsd:attribute name="customizer" type="xsd:string">
					<xsd:annotation>
						<xsd:documentation>
							Reference to a GroovyObjectCustomizer bean to be applied to this script.
						</xsd:documentation>
						<xsd:appinfo>
							<tool:expected-type
									type="org.springframework.scripting.groovy.GroovyObjectCustomizer"/>
						</xsd:appinfo>
					</xsd:annotation>
				</xsd:attribute>
				<xsd:attribute name="compile-static" default="false">
					<xsd:annotation>
						<xsd:documentation>
							Indicates if the target Groovy script should be compiled statically.
							The @CompileStatic hint is applied for the Groovy compiler.
							This attribute is ignored if the 'compiler-configuration' reference is specified.
						</xsd:documentation>
					</xsd:annotation>
					<xsd:simpleType>
						<xsd:union memberTypes="xsd:boolean xsd:string"/>
					</xsd:simpleType>
				</xsd:attribute>
				<xsd:attribute name="compiler-configuration">
					<xsd:annotation>
						<xsd:documentation>
							Reference to a CompilerConfiguration bean to be applied to the underlying GroovyClassLoader
							for this script compilation.
						</xsd:documentation>
						<xsd:appinfo>
							<tool:expected-type
									type="org.codehaus.groovy.control.CompilerConfiguration"/>
						</xsd:appinfo>
					</xsd:annotation>
				</xsd:attribute>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>


	<xsd:element name="control-bus">
		<xsd:annotation>
			<xsd:documentation>
				Control bus ('org.springframework.integration.groovy.config.GroovyControlBusFactoryBean') that accepts
				messages in the form of Groovy scripts. The scripts should be provided as
				String payload in incoming messages. The variable bindings will include any @ManagedResource, Lifecycle,
				or CustomizableThreadCreator instances from within the ApplicationContext.
			</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs="0" maxOccurs="2">
				<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:choice>
			<xsd:attributeGroup ref="integration:inputOutputChannelGroup"/>
			<xsd:attribute name="customizer" type="xsd:string">
				<xsd:annotation>
					<xsd:documentation>
						Reference to a GroovyObjectCustomizer bean to be
						applied to each script payload.
					</xsd:documentation>
					<xsd:appinfo>
						<tool:expected-type
								type="org.springframework.scripting.groovy.GroovyObjectCustomizer"/>
					</xsd:appinfo>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

</xsd:schema>
