43
43
*/
44
44
class ArtemisConnectionFactoryFactory {
45
45
46
- static final String EMBEDDED_JMS_CLASS = "org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS" ;
46
+ static final String [] EMBEDDED_JMS_CLASSES = { "org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS" ,
47
+ "org.apache.activemq.artemis.core.server.embedded.EmbeddedActiveMQ" };
47
48
48
49
private final ArtemisProperties properties ;
49
50
@@ -67,12 +68,14 @@ <T extends ActiveMQConnectionFactory> T createConnectionFactory(Class<T> factory
67
68
}
68
69
69
70
private void startEmbeddedJms () {
70
- if (ClassUtils .isPresent (EMBEDDED_JMS_CLASS , null )) {
71
- try {
72
- this .beanFactory .getBeansOfType (Class .forName (EMBEDDED_JMS_CLASS ));
73
- }
74
- catch (Exception ex ) {
75
- // Ignore
71
+ for (int i = 0 ; i < EMBEDDED_JMS_CLASSES .length ; i ++) {
72
+ if (ClassUtils .isPresent (EMBEDDED_JMS_CLASSES [i ], null )) {
73
+ try {
74
+ this .beanFactory .getBeansOfType (Class .forName (EMBEDDED_JMS_CLASSES [i ]));
75
+ }
76
+ catch (Exception ex ) {
77
+ // Ignore
78
+ }
76
79
}
77
80
}
78
81
}
@@ -93,12 +96,21 @@ private <T extends ActiveMQConnectionFactory> T doCreateConnectionFactory(Class<
93
96
* @return the mode
94
97
*/
95
98
private ArtemisMode deduceMode () {
96
- if (this .properties .getEmbedded ().isEnabled () && ClassUtils . isPresent ( EMBEDDED_JMS_CLASS , null )) {
99
+ if (this .properties .getEmbedded ().isEnabled () && isEmbeddedJmsClassPresent ( )) {
97
100
return ArtemisMode .EMBEDDED ;
98
101
}
99
102
return ArtemisMode .NATIVE ;
100
103
}
101
104
105
+ private boolean isEmbeddedJmsClassPresent () {
106
+ for (int i = 0 ; i < EMBEDDED_JMS_CLASSES .length ; i ++) {
107
+ if (ClassUtils .isPresent (EMBEDDED_JMS_CLASSES [i ], null )) {
108
+ return true ;
109
+ }
110
+ }
111
+ return false ;
112
+ }
113
+
102
114
private <T extends ActiveMQConnectionFactory > T createEmbeddedConnectionFactory (Class <T > factoryClass )
103
115
throws Exception {
104
116
try {
0 commit comments