Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
0c0be1e6
Commit
0c0be1e6
authored
Apr 10, 2016
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish contribution
parent
d0ccea1b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
22 deletions
+25
-22
ActiveMQConnectionFactoryFactory.java
...figure/jms/activemq/ActiveMQConnectionFactoryFactory.java
+10
-6
ActiveMQProperties.java
...k/boot/autoconfigure/jms/activemq/ActiveMQProperties.java
+9
-9
ActiveMQPropertiesTests.java
...t/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java
+4
-7
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+2
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryFactory.java
View file @
0c0be1e6
...
@@ -61,17 +61,21 @@ class ActiveMQConnectionFactoryFactory {
...
@@ -61,17 +61,21 @@ class ActiveMQConnectionFactoryFactory {
String
password
=
this
.
properties
.
getPassword
();
String
password
=
this
.
properties
.
getPassword
();
T
activeMqConnectionFactory
;
T
activeMqConnectionFactory
;
if
(
StringUtils
.
hasLength
(
user
)
&&
StringUtils
.
hasLength
(
password
))
{
if
(
StringUtils
.
hasLength
(
user
)
&&
StringUtils
.
hasLength
(
password
))
{
activeMqConnectionFactory
=
activeMqConnectionFactory
=
factoryClass
factoryClass
.
getConstructor
(
String
.
class
,
String
.
class
,
String
.
class
)
.
getConstructor
(
String
.
class
,
String
.
class
,
String
.
class
)
.
newInstance
(
user
,
password
,
brokerUrl
);
.
newInstance
(
user
,
password
,
brokerUrl
);
}
}
else
{
else
{
activeMqConnectionFactory
=
activeMqConnectionFactory
=
factoryClass
.
getConstructor
(
String
.
class
)
factoryClass
.
getConstructor
(
String
.
class
)
.
newInstance
(
brokerUrl
);
.
newInstance
(
brokerUrl
);
}
}
Packages
packages
=
this
.
properties
.
getPackages
();
Packages
packages
=
this
.
properties
.
getPackages
();
activeMqConnectionFactory
.
setTrustAllPackages
(
packages
.
isTrustAll
());
if
(
packages
.
getTrustAll
()
!=
null
)
{
activeMqConnectionFactory
.
setTrustedPackages
(
packages
.
getTrusted
());
activeMqConnectionFactory
.
setTrustAllPackages
(
packages
.
getTrustAll
());
}
if
(!
packages
.
getTrusted
().
isEmpty
())
{
activeMqConnectionFactory
.
setTrustedPackages
(
packages
.
getTrusted
());
}
return
activeMqConnectionFactory
;
return
activeMqConnectionFactory
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQProperties.java
View file @
0c0be1e6
...
@@ -123,10 +123,6 @@ public class ActiveMQProperties {
...
@@ -123,10 +123,6 @@ public class ActiveMQProperties {
return
this
.
packages
;
return
this
.
packages
;
}
}
public
void
setPackages
(
Packages
packages
)
{
this
.
packages
=
packages
;
}
public
static
class
Pool
{
public
static
class
Pool
{
/**
/**
...
@@ -186,17 +182,21 @@ public class ActiveMQProperties {
...
@@ -186,17 +182,21 @@ public class ActiveMQProperties {
public
static
class
Packages
{
public
static
class
Packages
{
/** Whether security check for trusted packages should be turned off. */
/**
private
boolean
trustAll
=
false
;
* Trust all packages.
*/
private
Boolean
trustAll
;
/** The packages to trust. */
/**
* The specific packages to trust (when not trusting all packages).
*/
private
List
<
String
>
trusted
=
new
ArrayList
<
String
>();
private
List
<
String
>
trusted
=
new
ArrayList
<
String
>();
public
boolean
is
TrustAll
()
{
public
Boolean
get
TrustAll
()
{
return
this
.
trustAll
;
return
this
.
trustAll
;
}
}
public
void
setTrustAll
(
b
oolean
trustAll
)
{
public
void
setTrustAll
(
B
oolean
trustAll
)
{
this
.
trustAll
=
trustAll
;
this
.
trustAll
=
trustAll
;
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQPropertiesTests.java
View file @
0c0be1e6
...
@@ -17,12 +17,10 @@
...
@@ -17,12 +17,10 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
jms
.
activemq
;
package
org
.
springframework
.
boot
.
autoconfigure
.
jms
.
activemq
;
import
org.apache.activemq.ActiveMQConnectionFactory
;
import
org.apache.activemq.ActiveMQConnectionFactory
;
import
org.junit.Test
;
import
org.junit.Test
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
/**
* Tests for {@link ActiveMQProperties} and {@link ActiveMQConnectionFactoryFactory}.
* Tests for {@link ActiveMQProperties} and {@link ActiveMQConnectionFactoryFactory}.
*
*
...
@@ -67,7 +65,7 @@ public class ActiveMQPropertiesTests {
...
@@ -67,7 +65,7 @@ public class ActiveMQPropertiesTests {
}
}
@Test
@Test
public
void
testPackagesTrustAllSetToTrue
()
{
public
void
setTrustAllPackages
()
{
this
.
properties
.
getPackages
().
setTrustAll
(
true
);
this
.
properties
.
getPackages
().
setTrustAll
(
true
);
assertThat
(
new
ActiveMQConnectionFactoryFactory
(
this
.
properties
)
assertThat
(
new
ActiveMQConnectionFactoryFactory
(
this
.
properties
)
.
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
)
.
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
)
...
@@ -75,12 +73,11 @@ public class ActiveMQPropertiesTests {
...
@@ -75,12 +73,11 @@ public class ActiveMQPropertiesTests {
}
}
@Test
@Test
public
void
testPackagesToTrust
()
{
public
void
setTrustedPackages
()
{
this
.
properties
.
getPackages
().
setTrustAll
(
false
);
this
.
properties
.
getPackages
().
setTrustAll
(
false
);
this
.
properties
.
getPackages
().
getTrusted
().
add
(
"trusted.package"
);
this
.
properties
.
getPackages
().
getTrusted
().
add
(
"trusted.package"
);
ActiveMQConnectionFactory
factory
=
ActiveMQConnectionFactory
factory
=
new
ActiveMQConnectionFactoryFactory
(
new
ActiveMQConnectionFactoryFactory
(
this
.
properties
)
this
.
properties
).
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
);
.
createConnectionFactory
(
ActiveMQConnectionFactory
.
class
);
assertThat
(
factory
.
isTrustAllPackages
()).
isEqualTo
(
false
);
assertThat
(
factory
.
isTrustAllPackages
()).
isEqualTo
(
false
);
assertThat
(
factory
.
getTrustedPackages
().
size
()).
isEqualTo
(
1
);
assertThat
(
factory
.
getTrustedPackages
().
size
()).
isEqualTo
(
1
);
assertThat
(
factory
.
getTrustedPackages
().
get
(
0
)).
isEqualTo
(
"trusted.package"
);
assertThat
(
factory
.
getTrustedPackages
().
get
(
0
)).
isEqualTo
(
"trusted.package"
);
...
...
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
0c0be1e6
...
@@ -770,6 +770,8 @@ content into your application; rather pick only the properties that you need.
...
@@ -770,6 +770,8 @@ content into your application; rather pick only the properties that you need.
spring.activemq.pool.expiry-timeout=0 # Connection expiration timeout in milliseconds.
spring.activemq.pool.expiry-timeout=0 # Connection expiration timeout in milliseconds.
spring.activemq.pool.idle-timeout=30000 # Connection idle timeout in milliseconds.
spring.activemq.pool.idle-timeout=30000 # Connection idle timeout in milliseconds.
spring.activemq.pool.max-connections=1 # Maximum number of pooled connections.
spring.activemq.pool.max-connections=1 # Maximum number of pooled connections.
spring.activemq.packages.trust-all= # Trust all packages
spring.activemq.packages.trusted= # The specific packages to trust (when not trusting all packages).
# ARTEMIS ({sc-spring-boot-autoconfigure}/jms/artemis/ArtemisProperties.{sc-ext}[ArtemisProperties])
# ARTEMIS ({sc-spring-boot-autoconfigure}/jms/artemis/ArtemisProperties.{sc-ext}[ArtemisProperties])
spring.artemis.embedded.cluster-password= # Cluster password. Randomly generated on startup by default.
spring.artemis.embedded.cluster-password= # Cluster password. Randomly generated on startup by default.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment