<?xml version="1.0" encoding="UTF-8"?>

<!--
	ActiveMQ XML DTD

  Which is an extension of the Spring XML DTD
	Authors: Rod Johnson, Juergen Hoeller

	This defines a simple and consistent way of creating a namespace
	of JavaBeans objects, configured by a Spring BeanFactory, read by
	a DefaultXmlBeanDefinitionReader.

	This document type is used by most Spring functionality, including
	web application contexts, which are based on bean factories.

	Each "bean" element in this document defines a JavaBean.
	Typically the bean class is specified, along with JavaBean properties
	and/or constructor arguments.

	Bean instances can be "singletons" (shared instances) or "prototypes"
	(independent instances). Further scopes are supposed to be built on top
	of the core BeanFactory infrastructure and are therefore not part of it.

	References among beans are supported, i.e. setting a JavaBean property
	or a constructor argument to refer to another bean in the same factory
	(or an ancestor factory).

	As alternative to bean references, "inner bean definitions" can be used.
	Singleton flags of such inner bean definitions are effectively ignored:
	Inner beans are typically anonymous prototypes.

	There is also support for lists, sets, maps, and java.util.Properties
	as bean property types respectively constructor argument types.

	As the format is simple, a DTD is sufficient, and there's no need
	for a schema at this point.

	XML documents that conform to this DTD should declare the following doctype:

	<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
		"http://www.springframework.org/dtd/spring-beans.dtd">

	$Id$
-->


<!--
	Element containing informative text describing the purpose of the enclosing
	element. Always optional.
	Used primarily for user documentation of XML bean definition documents.
-->
<!ELEMENT description (#PCDATA)>

<!--
	The document root.
	At least one bean definition is required.
-->
<!ELEMENT beans (
        description?,
        (broker | bean)+
)>

<!--
	Default values for all bean definitions. Can be overridden at
	the "bean" level. See those attribute definitions for details.
-->
<!ATTLIST beans default-lazy-init (true | false) "false">
<!ATTLIST beans default-dependency-check (none | objects | simple | all) "none">
<!ATTLIST beans default-autowire (no | byName | byType | constructor | autodetect) "no">

<!--
	Defines the JMS Message Broker
-->
<!ELEMENT broker (
        description?,
        (connector)+,
        (discoveryAgent |networkConnector | discoveryNetworkConnector)*,
        (persistence)?,
        (redeliveryPolicy)?,
        (security)?
)>
<!ATTLIST broker name CDATA #IMPLIED>
<!ATTLIST broker maxMem CDATA #IMPLIED>


<!--
	Defines the Message Broker Connector which is used to connect
  clients to the broker
-->
<!ELEMENT connector (
        description?,
        (serverTransport | tcpServerTransport)
)>
<!ATTLIST connector class CDATA #IMPLIED>




<!--
 ============================================================================
 == Transport Providers                                                    ==
 ============================================================================
-->

<!--
	Defines the Transport used by the Message Broker
-->
<!ELEMENT serverTransport (
        description?,
        (wireFormat | property)*
)>
<!ATTLIST serverTransport class CDATA #IMPLIED>
<!ATTLIST serverTransport uri CDATA #REQUIRED>

<!--
  Defines the TCP Transport used by the Message Broker
-->
<!ELEMENT tcpServerTransport (
        description?,
        (wireFormat | property)*
)>

<!--
  The URL to connect to
-->
<!ATTLIST tcpServerTransport uri CDATA #REQUIRED>

<!--
  Allows the implementation class to be overloaded
-->
<!ATTLIST tcpServerTransport class CDATA #IMPLIED>

<!--
  The maximum length of the server socket queue
-->
<!ATTLIST tcpServerTransport backlog CDATA #IMPLIED>

<!--
  Whether or not sends from the broker to the client should be async
-->
<!ATTLIST tcpServerTransport useAsyncSend (true | false) "false">

<!--
  If using async sends then what is the maximum number of outstanding messages
-->
<!ATTLIST tcpServerTransport maxOutstandingMessages CDATA #IMPLIED>


<!ELEMENT wireFormat (
        description?
)>
<!ATTLIST wireFormat class CDATA #IMPLIED>




<!--
 ============================================================================
 == Network Providers (for connecting brokers together)                    ==
 ============================================================================
-->

<!--
	Defines a NetworkConnector which is used to connect
  remote brokers to
-->
<!ELEMENT networkConnector (
        description?,
        (property)*,
        (networkChannel)+
)>
<!ATTLIST networkConnector class CDATA #IMPLIED>

<!--
	Defines a single channel to a remote broker
-->
<!ELEMENT networkChannel (
        description?,
        (property)*
)>
<!ATTLIST networkChannel class CDATA #IMPLIED>
<!ATTLIST networkChannel uri CDATA #REQUIRED>
<!ATTLIST networkChannel remoteUserName CDATA #IMPLIED>
<!ATTLIST networkChannel remotePassword CDATA #IMPLIED>
<!ATTLIST networkChannel remoteBrokerName CDATA #IMPLIED>

<!--
  the maximum number of retries that should be attempted with the remote
  broker or zero to never stop attempting to connect
-->
<!ATTLIST networkChannel maximumRetries CDATA #IMPLIED>

<!--
  The amount of time, in millis, between attempting to reconnect to
  a remote broker
-->
<!ATTLIST networkChannel reconnectSleepTime CDATA #IMPLIED>

<!--
	Defines a discovery based connector to a cluster of brokers.
  Note that the broker must have a discoveryAgent if this option is used
-->
<!ELEMENT discoveryNetworkConnector (
        description?,
        (property)*
)>
<!ATTLIST discoveryNetworkConnector class CDATA #IMPLIED>
<!ATTLIST discoveryNetworkConnector remoteUserName CDATA #IMPLIED>
<!ATTLIST discoveryNetworkConnector remotePassword CDATA #IMPLIED>


<!--
	Defines a discovery agent for announcing a broker to other clients or
  for discovering other brokers and services
-->
<!ELEMENT discoveryAgent (
        description?,
        (multicastDiscovery | zeroconfDiscovery | activeClusterDiscovery | bean)
)>

<!--
	A discovery agent using ActiveMQ's multicast discovery
-->
<!ELEMENT multicastDiscovery (
        description?,
        (property)*
)>
<!ATTLIST multicastDiscovery class CDATA #IMPLIED>
<!ATTLIST multicastDiscovery channelName CDATA #REQUIRED>
<!ATTLIST multicastDiscovery keepAliveTimeout CDATA #IMPLIED>
<!ATTLIST multicastDiscovery timeoutCount CDATA #IMPLIED>
<!ATTLIST multicastDiscovery localId CDATA #IMPLIED>
<!ATTLIST multicastDiscovery uri CDATA #IMPLIED>
<!ATTLIST multicastDiscovery timeToLive CDATA #IMPLIED>

<!--
	A discovery agent using Zeroconf via the jmDNS project to discover services
  http://jmdns.sf.net/
-->
<!ELEMENT zeroconfDiscovery (
        description?,
        (property)*
)>
<!ATTLIST zeroconfDiscovery class CDATA #IMPLIED>
<!ATTLIST zeroconfDiscovery type CDATA #REQUIRED>
<!ATTLIST zeroconfDiscovery localhost CDATA #IMPLIED>
<!ATTLIST zeroconfDiscovery priority CDATA #IMPLIED>
<!ATTLIST zeroconfDiscovery weight CDATA #IMPLIED>

<!--
	A discovery agent using ActiveCluster to discover services
  http://activecluster.org/
-->
<!ELEMENT activeClusterDiscovery (
        description?,
        (property)*
)>
<!ATTLIST activeClusterDiscovery class CDATA #IMPLIED>
<!ATTLIST activeClusterDiscovery uri CDATA #REQUIRED>
<!ATTLIST activeClusterDiscovery subject CDATA #REQUIRED>



<!--
 ============================================================================
 == Security Providers                                                     ==
 ============================================================================
-->

<!--
	A pluggable security adapter
-->
<!ELEMENT security (
        description?,
        (bean)?
)>



<!--
 ============================================================================
 == Redelivery Policy                                                      ==
 ============================================================================
-->

<!--
	This policy configures how messages should be redelivered
  if a rollback() occurs due to either the message being corrupted
  or some dependent system resource (database or back end system) being
  unavailable when the message was delivered.
-->
<!ELEMENT redeliveryPolicy (
        description?,
        (property)*
)>

<!ATTLIST redeliveryPolicy class CDATA #IMPLIED>

<!--
  how many times will a message be redelivered before
  being sent to a Dead Letter Queue
-->
<!ATTLIST redeliveryPolicy maximumRetryCount CDATA #IMPLIED>

<!--
  If enabled, back off mode uses an increasing rate of timeouts
-->
<!ATTLIST redeliveryPolicy backOffMode (true | false) "true">

<!--
  The initial timeout for redelivery
-->
<!ATTLIST redeliveryPolicy initialRedeliveryTimeout CDATA #IMPLIED>

<!--
  The rate of increase in the timeout
-->
<!ATTLIST redeliveryPolicy backOffIncreaseRate CDATA #IMPLIED>

<!--
 ============================================================================
 == Persistence Providers                                                  ==
 ============================================================================
-->

<!--
	A pluggable persistence adapter
-->
<!ELEMENT persistence (
        description?,
        (bean | berkeleyDbPersistence | jdbcPersistence | jdbmPersistence | vmPersistence | journalPersistence | cachePersistence )?
)>

<!--
	VM based persistence (i.e. no persistence)
-->
<!ELEMENT vmPersistence (
        description?,
        (constructor-arg | property)*,
		(lookup-method)*
)>
<!ATTLIST vmPersistence class CDATA #IMPLIED>


<!--
	Berkeley DB based persistence
-->
<!ELEMENT berkeleyDbPersistence (
        description?,
        (constructor-arg | property)*,
		(lookup-method)*
)>
<!-- the directory in which the persistent files are stored -->
<!ATTLIST berkeleyDbPersistence directory CDATA #REQUIRED>
<!ATTLIST berkeleyDbPersistence class CDATA #IMPLIED>


<!--
	JDBM DB based persistence
-->
<!ELEMENT jdbmPersistence (
        description?,
        (constructor-arg | property)*,
		(lookup-method)*
)>
<!-- the directory in which the persistent files are stored -->
<!ATTLIST jdbmPersistence directory CDATA #REQUIRED>
<!ATTLIST jdbmPersistence class CDATA #IMPLIED>

<!--
	JDBC based persistence
-->
<!ELEMENT jdbcPersistence (
        description?,
        (constructor-arg | property)*,
		(lookup-method)*
)>
<!ATTLIST jdbcPersistence class CDATA #IMPLIED>
<!ATTLIST jdbcPersistence wireFormat CDATA #IMPLIED>
<!ATTLIST jdbcPersistence dataSourceRef CDATA #IMPLIED>
<!ATTLIST jdbcPersistence adapterClass CDATA #IMPLIED>

<!--
	Journal based persistence for a high performance transaction log
-->
<!ELEMENT journalPersistence (
        description?,
        (persistence | berkeleyDbPersistence | jdbcPersistence | jdbmPersistence | vmPersistence)
)>
<!ATTLIST journalPersistence sync CDATA #IMPLIED>
<!ATTLIST journalPersistence directory CDATA #IMPLIED>
<!ATTLIST journalPersistence journalType CDATA #IMPLIED>


<!--
	Cache persistence for to increase the performance of another Persistence Store
-->
<!ELEMENT cachePersistence (
        description?,
        (persistence | berkeleyDbPersistence | jdbcPersistence | jdbmPersistence | journalPersistence)
)>




<!--
 ============================================================================
 == Spring Configuration                                                   ==
 ============================================================================
-->

<!--
	Defines a single named bean.
-->
<!ELEMENT bean (
        description?,
        (constructor-arg | property)*,
		(lookup-method)*
)>

<!--
	Beans can be identified by an id, to enable reference checking.
	There are constraints on a valid XML id: if you want to reference your bean
	in Java code using a name that's illegal as an XML id, use the optional
	"name" attribute. If neither given, the bean class name is used as id.
-->
<!ATTLIST bean id ID #IMPLIED>

<!--
	Optional. Can be used to create one or more aliases illegal in an id.
	Multiple aliases can be separated by any number of spaces or commas.
-->
<!ATTLIST bean name CDATA #IMPLIED>

<!--
	Each bean definition must specify the FQN of the class,
	or the name of the parent bean from which the class can be worked out.

	Note that a child bean definition that references a parent will just
	add respectively override property values and be able to change the
	singleton status. It will inherit all of the parent's other parameters
	like lazy initialization or autowire settings.
-->
<!ATTLIST bean class CDATA #IMPLIED>
<!ATTLIST bean parent CDATA #IMPLIED>

<!--
	Is this bean a "singleton" (one shared instance, which will
	be returned by all calls to getBean() with the id),
	or a "prototype" (independent instance resulting from each call to
	getBean(). Default is singleton.

	Singletons are most commonly used, and are ideal for multi-threaded
	service objects.
-->
<!ATTLIST bean singleton (true | false) "true">

<!--
	If this bean should be lazily initialized.
	If false, it will get instantiated on startup by bean factories
	that perform eager initialization of singletons.
-->
<!ATTLIST bean lazy-init (true | false | default) "default">

<!--
	Optional attribute controlling whether to "autowire" bean properties.
	This is an automagical process in which bean references don't need to be coded
	explicitly in the XML bean definition file, but Spring works out dependencies.

	There are 5 modes:

	1. "no"
	The traditional Spring default. No automagical wiring. Bean references
	must be defined in the XML file via the <ref> element. We recommend this
	in most cases as it makes documentation more explicit.

	2. "byName"
	Autowiring by property name. If a bean of class Cat exposes a dog property,
	Spring will try to set this to the value of the bean "dog" in the current factory.

	3. "byType"
	Autowiring if there is exactly one bean of the property type in the bean factory.
	If there is more than one, a fatal error is raised, and you can't use byType
	autowiring for that bean. If there is none, nothing special happens - use
	dependency-check="objects" to raise an error in that case.

	4. "constructor"
	Analogous to "byType" for constructor arguments. If there isn't exactly one bean
	of the constructor argument type in the bean factory, a fatal error is raised.

	5. "autodetect"
	Chooses "constructor" or "byType" through introspection of the bean class.
	If a default constructor is found, "byType" gets applied.

	The latter two are similar to PicoContainer and make bean factories simple to
	configure for small namespaces, but doesn't work as well as standard Spring
	behaviour for bigger applications.

	Note that explicit dependencies, i.e. "property" and "constructor-arg" elements,
	always override autowiring. Autowire behaviour can be combined with dependency
	checking, which will be performed after all autowiring has been completed.
-->
<!ATTLIST bean autowire (no | byName | byType | constructor | autodetect | default) "default">

<!--
	Optional attribute controlling whether to check whether all this
	beans dependencies, expressed in its properties, are satisfied.
	Default is no dependency checking.

	"simple" type dependency checking includes primitives and String
	"object" includes collaborators (other beans in the factory)
	"all" includes both types of dependency checking
-->
<!ATTLIST bean dependency-check (none | objects | simple | all | default) "default">

<!--
	The names of the beans that this bean depends on being initialized.
	The bean factory will guarantee that these beans get initialized before.

	Note that dependencies are normally expressed through bean properties or
	constructor arguments. This property should just be necessary for other kinds
	of dependencies like statics (*ugh*) or database preparation on startup.
-->
<!ATTLIST bean depends-on CDATA #IMPLIED>

<!--
	Optional attribute for the name of the custom initialization method
	to invoke after setting bean properties. The method must have no arguments,
	but may throw any exception.
-->
<!ATTLIST bean init-method CDATA #IMPLIED>

<!--
	Optional attribute for the name of the custom destroy method to invoke
	on bean factory shutdown. The method must have no arguments,
	but may throw any exception. Note: Only invoked on singleton beans!
-->
<!ATTLIST bean destroy-method CDATA #IMPLIED>

<!--
	Optional attribute specifying the name of a static factory method to use
	to create this object. Use constructor-arg elements to specify arguments
	to the factory method, if it takes arguments. Autowiring does not
	apply to factory methods.
	The factory method will be on the class specified by the "class" attribute
	on this bean definition. Often this will be the same class as that of the
	constructed object - for example, when the factory method is used as an
	alternative to a constructor. However, it may be on a different class. In
	that case, the created object will *not* be of the class specified in
	the "class" attribute. This is analogous to FactoryBean behaviour.

	The factory method can have any number of arguments. Autowiring is not supported.
	Use indexed constructor-arg elements in conjunction with the factory-method
	attribute.

	Setter Injection can be used in conjunction with a factory method.
	Method Injection cannot, as the factory method returns an instance, which
	will be used when the container creates the bean.
-->
<!ATTLIST bean factory-method CDATA #IMPLIED>

<!--
	Bean definitions can specify zero or more constructor arguments.
	They correspond to either a specific index of the constructor argument list
	or are supposed to be matched generically by type.
	This is an alternative to "autowire constructor".
	constructor-arg elements are also used in conjunction with the factory-method
	element to construct beans using static factory methods.
-->
<!ELEMENT constructor-arg (
        description?,
        (bean | ref | idref | list | set | map | props | value | null)
)>

<!--
	The constructor-arg tag can have an optional index attribute,
	to specify the exact index in the constructor argument list. Only needed
	to avoid ambiguities, e.g. in case of 2 arguments of the same type.
-->
<!ATTLIST constructor-arg index CDATA #IMPLIED>

<!--
	The constructor-arg tag can have an optional type attribute,
	to specify the exact type of the constructor argument. Only needed
	to avoid ambiguities, e.g. in case of 2 single argument constructors
	that can both be converted from a String.
-->
<!ATTLIST constructor-arg type CDATA #IMPLIED>

<!--
	Bean definitions can have zero or more properties.
	Property elements correspond to JavaBean setter methods exposed
	by the bean classes. Spring supports primitives, references to other
	beans in the same or related factories, lists, maps and properties.
-->
<!ELEMENT property (
        description?,
        (bean | ref | idref | list | set | map | props | value | null)
)>

<!--
	The property name attribute is the name of the JavaBean property.
	This follows JavaBean conventions: a name of "age" would correspond
	to setAge()/optional getAge() methods.
-->
<!ATTLIST property name CDATA #REQUIRED>

<!--
	Defines a reference to another bean in this factory or an external
	factory (parent or included factory).
-->
<!ELEMENT ref EMPTY>

<!--
	References must specify a name of the target bean.
	The "bean" attribute can reference any name from any bean in the context,
	to be checked at runtime.
	Local references, using the "local" attribute, have to use bean ids;
	they can be checked by this DTD, thus should be preferred for references
	within the same bean factory XML file.
-->
<!ATTLIST ref bean CDATA #IMPLIED>
<!ATTLIST ref local IDREF #IMPLIED>
<!ATTLIST ref parent CDATA #IMPLIED>

<!--
	Defines a string property value, which must also be the id of another
	bean in this factory or an external factory (parent or included factory).
	While a regular 'value' element could instead be used for the same effect,
	using idref in this case allows validation of local bean ids by the xml
	parser, and name completion by helper tools.
-->
<!ELEMENT idref EMPTY>

<!--
	ID refs must specify a name of the target bean.
	The "bean" attribute can reference any name from any bean in the context,
	potentially to be checked at runtime by bean factory implementations.
	Local references, using the "local" attribute, have to use bean ids;
	they can be checked by this DTD, thus should be preferred for references
	within the same bean factory XML file.
-->
<!ATTLIST idref bean CDATA #IMPLIED>
<!ATTLIST idref local IDREF #IMPLIED>

<!--
	A lookup method causes the IoC container to override the given method and return
	the bean with the name given in the bean attribute. This is a form of Method Injection.
	It's particularly useful as an alternative to implementing the BeanFactoryAware
	interface, in order to be able to make getBean() calls for non-singleton instances
	at runtime. In this case, Method Injection is a less invasive alternative.
-->
<!ELEMENT lookup-method EMPTY>

<!--
	Name of a lookup method. This method should take no arguments.
-->
<!ATTLIST lookup-method name CDATA #IMPLIED>

<!--
	Name of the bean in the current or ancestor factories that the lookup method
	should resolve to. Often this bean will be a prototype, in which case the
	lookup method will return a distinct instance on every invocation. This
	is useful for single-threaded objects.
-->
<!ATTLIST lookup-method bean CDATA #IMPLIED>


<!--
	A list can contain multiple inner bean, ref, collection, or value elements.
	Java lists are untyped, pending generics support in Java 1.5,
	although references will be strongly typed.
	A list can also map to an array type. The necessary conversion
	is automatically performed by the BeanFactory.
-->
<!ELEMENT list (
        (bean | ref | idref | list | set | map | props | value | null)*
)>

<!--
	A set can contain multiple inner bean, ref, collection, or value elements.
	Java sets are untyped, pending generics support in Java 1.5,
	although references will be strongly typed.
-->
<!ELEMENT set (
        (bean | ref | idref | list | set | map | props | value | null)*
)>

<!--
	A Spring map is a mapping from a string key to object.
	Maps may be empty.
-->
<!ELEMENT map (
        (entry)*
)>

<!--
	A map entry can be an inner bean, ref, collection, or value.
	The name of the property is given by the "key" attribute.
-->
<!ELEMENT entry (
        (bean | ref | idref | list | set | map | props | value | null)
)>

<!--
	Each map element must specify its key.
-->
<!ATTLIST entry key CDATA #REQUIRED>

<!--
	Props elements differ from map elements in that values must be strings.
	Props may be empty.
-->
<!ELEMENT props (
        (prop)*
)>

<!--
	Element content is the string value of the property.
	Note that whitespace is trimmed off to avoid unwanted whitespace
	caused by typical XML formatting.
-->
<!ELEMENT prop
(#PCDATA)
>

<!--
	Each property element must specify its key.
-->
<!ATTLIST prop key CDATA #REQUIRED>

<!--
	Contains a string representation of a property value.
	The property may be a string, or may be converted to the
	required type using the JavaBeans PropertyEditor
	machinery. This makes it possible for application developers
	to write custom PropertyEditor implementations that can
	convert strings to objects.

	Note that this is recommended for simple objects only.
	Configure more complex objects by populating JavaBean
	properties with references to other beans.
-->
<!ELEMENT value (#PCDATA)>

<!--
	Denotes a Java null value. Necessary because an empty "value" tag
	will resolve to an empty String, which will not be resolved to a
	null value unless a special PropertyEditor does so.
-->
<!ELEMENT null (#PCDATA)>
