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
a374929c
Commit
a374929c
authored
Jun 15, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
2f12dc82
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
30 deletions
+30
-30
JmxAutoConfiguration.java
...ramework/boot/autoconfigure/jmx/JmxAutoConfiguration.java
+15
-13
CommandRunner.java
...a/org/springframework/boot/cli/command/CommandRunner.java
+4
-3
ExitStatus.java
...g/springframework/boot/cli/command/status/ExitStatus.java
+2
-4
spring-boot-cli.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc
+9
-10
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxAutoConfiguration.java
View file @
a374929c
...
...
@@ -20,6 +20,7 @@ import javax.management.MBeanServer;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.FactoryBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnClass
;
...
...
@@ -87,7 +88,15 @@ public class JmxAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
MBeanServer
.
class
)
public
MBeanServer
mbeanServer
()
{
return
SpecificPlatform
.
get
().
getMBeanServer
();
SpecificPlatform
platform
=
SpecificPlatform
.
get
();
if
(
platform
!=
null
)
{
return
platform
.
getMBeanServer
();
}
MBeanServerFactoryBean
factory
=
new
MBeanServerFactoryBean
();
factory
.
setLocateExistingServerIfPossible
(
true
);
factory
.
afterPropertiesSet
();
return
factory
.
getObject
();
}
@EnableMBeanExport
(
defaultDomain
=
"${spring.jmx.default_domain:}"
,
server
=
"${spring.jmx.server:mbeanServer}"
)
...
...
@@ -112,16 +121,6 @@ public class JmxAutoConfiguration {
public
FactoryBean
<
MBeanServer
>
getMBeanServerFactory
()
{
return
new
WebSphereMBeanServerFactoryBean
();
}
},
GENERIC
(
"org.springframework.jmx.support.MBeanServerFactoryBean"
)
{
@Override
public
FactoryBean
<
MBeanServer
>
getMBeanServerFactory
()
{
MBeanServerFactoryBean
factory
=
new
MBeanServerFactoryBean
();
factory
.
setLocateExistingServerIfPossible
(
true
);
factory
.
afterPropertiesSet
();
return
factory
;
}
};
private
final
String
identifyingClass
;
...
...
@@ -131,9 +130,12 @@ public class JmxAutoConfiguration {
}
public
MBeanServer
getMBeanServer
()
{
Object
server
;
try
{
server
=
getMBeanServerFactory
().
getObject
();
FactoryBean
<?>
factory
=
getMBeanServerFactory
();
if
(
factory
instanceof
InitializingBean
)
{
((
InitializingBean
)
factory
).
afterPropertiesSet
();
}
Object
server
=
factory
.
getObject
();
Assert
.
isInstanceOf
(
MBeanServer
.
class
,
server
);
return
(
MBeanServer
)
server
;
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandRunner.java
View file @
a374929c
...
...
@@ -169,9 +169,10 @@ public class CommandRunner implements Iterable<Command> {
try
{
ExitStatus
result
=
run
(
argsWithoutDebugFlags
);
// The caller will hang up if it gets a non-zero status
return
result
==
null
?
0
:
result
.
isHangup
()
?
(
result
.
getCode
()
>
0
?
result
.
getCode
()
:
0
)
:
0
;
if
(
result
!=
null
&&
result
.
isHangup
())
{
return
(
result
.
getCode
()
>
0
?
result
.
getCode
()
:
0
);
}
return
0
;
}
catch
(
NoArgumentsException
ex
)
{
showUsage
();
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/status/ExitStatus.java
View file @
a374929c
...
...
@@ -27,12 +27,12 @@ package org.springframework.boot.cli.command.status;
public
final
class
ExitStatus
{
/**
* Generic "OK" exit status with zero exit code and
hangup=fa;se
* Generic "OK" exit status with zero exit code and
{@literal hangup=false}
*/
public
static
ExitStatus
OK
=
new
ExitStatus
(
0
,
"OK"
);
/**
* Generic "not OK" exit status with non-zero exit code and
hangup=true
* Generic "not OK" exit status with non-zero exit code and
{@literal hangup=true}
*/
public
static
ExitStatus
ERROR
=
new
ExitStatus
(-
1
,
"ERROR"
,
true
);
...
...
@@ -44,7 +44,6 @@ public final class ExitStatus {
/**
* Create a new ExitStatus with an exit code and name as specified.
*
* @param code the exit code
* @param name the name
*/
...
...
@@ -90,7 +89,6 @@ public final class ExitStatus {
/**
* Convert the existing code to a hangup.
*
* @return a new ExitStatus with hangup=true
*/
public
ExitStatus
hangup
()
{
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-cli.adoc
View file @
a374929c
...
...
@@ -265,24 +265,23 @@ executable jar file. For example:
$ spring jar my-app.jar *.groovy
----
The resulting jar will contain the classes produced by compiling the
application and all of the application's dependencies so that it can
then be run using `java -jar`. The jar file will also contain entries
from the application's classpath. You can add explicit paths to the
jar using `--include` and `--exclude` (both are comma separated, and
both accept prefixes to the values "+" and "-" to signify that they
shoudl be removed from the defaults). The default includes are
The resulting jar will contain the classes produced by compiling the application and all
of the application's dependencies so that it can then be run using `java -jar`. The jar
file will also contain entries from the application's classpath. You can add explicit
paths to the jar using `--include` and `--exclude` (both are comma separated, and both
accept prefixes to the values ``+'' and ``-'' to signify that they should be removed from
the defaults). The default includes are
[indent=0]
----
public/**, resources/**, static/**, templates/**, META-INF/**, *
public/**, resources/**, static/**, templates/**, META-INF/**, *
----
and the default excludes are
and the default excludes are
[indent=0]
----
.*, repository/**, build/**, target/**, **/*.jar, **/*.groovy
.*, repository/**, build/**, target/**, **/*.jar, **/*.groovy
----
See the output of `spring help jar` for more information.
...
...
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