Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
spring-boot-admin
Project
Overview
Details
Activity
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
openSource
spring-boot-admin
Commits
5accd407
Commit
5accd407
authored
Jul 04, 2014
by
Thomas Bosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some comments
parent
efa71e4c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
1 deletion
+36
-1
SpringBootAdmin.java
src/main/java/de/codecentric/boot/admin/SpringBootAdmin.java
+6
-0
WebappConfig.java
...n/java/de/codecentric/boot/admin/config/WebappConfig.java
+9
-0
RegistryController.java
...codecentric/boot/admin/controller/RegistryController.java
+19
-0
ApplicationRegistry.java
...e/codecentric/boot/admin/service/ApplicationRegistry.java
+2
-1
No files found.
src/main/java/de/codecentric/boot/admin/SpringBootAdmin.java
View file @
5accd407
...
...
@@ -12,6 +12,12 @@ import de.codecentric.boot.admin.config.WebappConfig;
@Import
(
WebappConfig
.
class
)
public
class
SpringBootAdmin
{
/**
* Starting point for application to boot.
*
* @param args
* Passed arguments.
*/
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SpringBootAdmin
.
class
,
args
);
}
...
...
src/main/java/de/codecentric/boot/admin/config/WebappConfig.java
View file @
5accd407
...
...
@@ -14,16 +14,25 @@ import de.codecentric.boot.admin.service.ApplicationRegistry;
@Configuration
public
class
WebappConfig
extends
WebMvcConfigurerAdapter
{
/**
* Add JSON MessageConverter to send JSON objects to web clients.
*/
@Override
public
void
configureMessageConverters
(
List
<
HttpMessageConverter
<?>>
converters
)
{
converters
.
add
(
new
MappingJackson2HttpMessageConverter
());
}
/**
* Controller with REST-API for spring-boot applications to register itself.
*/
@Bean
public
RegistryController
registryController
()
{
return
new
RegistryController
();
}
/**
* Registry for all registered application.
*/
@Bean
public
ApplicationRegistry
applicationRegistry
()
{
return
new
ApplicationRegistry
();
...
...
src/main/java/de/codecentric/boot/admin/controller/RegistryController.java
View file @
5accd407
...
...
@@ -26,6 +26,13 @@ public class RegistryController {
@Autowired
private
ApplicationRegistry
registry
;
/**
* Register an application within this admin application.
*
* @param app
* The application infos.
* @return The registered application.
*/
@RequestMapping
(
value
=
"/api/applications"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
Application
register
(
@RequestBody
Application
app
)
{
...
...
@@ -33,6 +40,13 @@ public class RegistryController {
return
registry
.
register
(
app
);
}
/**
* Get a single application out of the registry.
*
* @param id
* The application identifier.
* @return The registered application.
*/
@RequestMapping
(
value
=
"/api/application/{id}"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
Application
get
(
@PathVariable
String
id
)
{
...
...
@@ -40,6 +54,11 @@ public class RegistryController {
return
registry
.
getApplication
(
id
);
}
/**
* List all registered applications.
*
* @return List.
*/
@RequestMapping
(
value
=
"/api/applications"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
List
<
Application
>
applications
()
{
...
...
src/main/java/de/codecentric/boot/admin/service/ApplicationRegistry.java
View file @
5accd407
...
...
@@ -11,7 +11,8 @@ import org.springframework.stereotype.Service;
import
de.codecentric.boot.admin.model.Application
;
/**
* Registry for all applications that should be managed/administrated by the spring-boot-admin application.
* Registry for all applications that should be managed/administrated by the spring-boot-admin application. This
* registry is just "in-memory", so that after a restart all applications have to be registered again.
*/
@Service
public
class
ApplicationRegistry
{
...
...
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