001/*
002 * Copyright 2012-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.autoconfigure.jms.artemis;
018
019import javax.jms.ConnectionFactory;
020
021import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
022
023import org.springframework.boot.autoconfigure.AutoConfigureAfter;
024import org.springframework.boot.autoconfigure.AutoConfigureBefore;
025import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
026import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
027import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
028import org.springframework.boot.autoconfigure.jms.JmsAutoConfiguration;
029import org.springframework.boot.autoconfigure.jms.JmsProperties;
030import org.springframework.boot.autoconfigure.jms.JndiConnectionFactoryAutoConfiguration;
031import org.springframework.boot.context.properties.EnableConfigurationProperties;
032import org.springframework.context.annotation.Configuration;
033import org.springframework.context.annotation.Import;
034
035/**
036 * {@link EnableAutoConfiguration Auto-configuration} to integrate with an Artemis broker.
037 * If the necessary classes are present, embed the broker in the application by default.
038 * Otherwise, connect to a broker available on the local machine with the default
039 * settings.
040 *
041 * @author EddĂș MelĂ©ndez
042 * @author Stephane Nicoll
043 * @since 1.3.0
044 * @see ArtemisProperties
045 */
046@Configuration
047@AutoConfigureBefore(JmsAutoConfiguration.class)
048@AutoConfigureAfter({ JndiConnectionFactoryAutoConfiguration.class })
049@ConditionalOnClass({ ConnectionFactory.class, ActiveMQConnectionFactory.class })
050@ConditionalOnMissingBean(ConnectionFactory.class)
051@EnableConfigurationProperties({ ArtemisProperties.class, JmsProperties.class })
052@Import({ ArtemisEmbeddedServerConfiguration.class,
053                ArtemisXAConnectionFactoryConfiguration.class,
054                ArtemisConnectionFactoryConfiguration.class })
055public class ArtemisAutoConfiguration {
056
057}