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
93141a7b
Commit
93141a7b
authored
Jun 05, 2014
by
Thomas Bosch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
application registry
parent
a872846c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
187 additions
and
0 deletions
+187
-0
pom.xml
pom.xml
+52
-0
SpringBootAdmin.java
src/main/java/de/codecentric/SpringBootAdmin.java
+17
-0
WebappConfig.java
src/main/java/de/codecentric/config/WebappConfig.java
+18
-0
RegistryController.java
...in/java/de/codecentric/controller/RegistryController.java
+35
-0
Application.java
src/main/java/de/codecentric/model/Application.java
+37
-0
ApplicationRegistry.java
...main/java/de/codecentric/service/ApplicationRegistry.java
+28
-0
application.properties
src/main/resources/application.properties
+0
-0
No files found.
pom.xml
View file @
93141a7b
...
...
@@ -4,4 +4,55 @@
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<properties>
<spring-boot.version>
1.0.2.RELEASE
</spring-boot.version>
<spring.version>
4.0.3.RELEASE
</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<version>
${spring-boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
<version>
2.3.3
</version>
</dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-lang3
</artifactId>
<version>
3.3.2
</version>
</dependency>
</dependencies>
<build>
<finalName>
${project.artifactId}
</finalName>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.1
</version>
<configuration>
<source>
1.7
</source>
<target>
1.7
</target>
<encoding>
utf8
</encoding>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
${spring-boot.version}
</version>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>
de.codecentric.SpringBootAdmin
</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
src/main/java/de/codecentric/SpringBootAdmin.java
0 → 100644
View file @
93141a7b
package
de
.
codecentric
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@EnableAutoConfiguration
@ComponentScan
public
class
SpringBootAdmin
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SpringBootAdmin
.
class
,
args
);
}
}
src/main/java/de/codecentric/config/WebappConfig.java
0 → 100644
View file @
93141a7b
package
de
.
codecentric
.
config
;
import
java.util.List
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.http.converter.HttpMessageConverter
;
import
org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
@Configuration
public
class
WebappConfig
extends
WebMvcConfigurerAdapter
{
@Override
public
void
configureMessageConverters
(
List
<
HttpMessageConverter
<?>>
converters
)
{
converters
.
add
(
new
MappingJackson2HttpMessageConverter
());
}
}
src/main/java/de/codecentric/controller/RegistryController.java
0 → 100644
View file @
93141a7b
package
de
.
codecentric
.
controller
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
de.codecentric.model.Application
;
import
de.codecentric.service.ApplicationRegistry
;
@Controller
public
class
RegistryController
{
@Autowired
private
ApplicationRegistry
registry
;
@RequestMapping
(
value
=
"/api/applications"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
void
register
(
@RequestBody
Application
app
)
{
System
.
out
.
println
(
"register "
+
app
);
registry
.
register
(
app
);
}
@RequestMapping
(
value
=
"/api/applications"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
List
<
Application
>
applications
()
{
System
.
out
.
println
(
"get all"
);
return
registry
.
getApplications
();
}
}
src/main/java/de/codecentric/model/Application.java
0 → 100644
View file @
93141a7b
package
de
.
codecentric
.
model
;
import
java.io.Serializable
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
public
class
Application
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
id
;
private
String
url
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
@Override
public
String
toString
()
{
return
ToStringBuilder
.
reflectionToString
(
this
,
ToStringStyle
.
SHORT_PREFIX_STYLE
);
}
}
src/main/java/de/codecentric/service/ApplicationRegistry.java
0 → 100644
View file @
93141a7b
package
de
.
codecentric
.
service
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
org.apache.commons.lang3.Validate
;
import
org.springframework.stereotype.Service
;
import
de.codecentric.model.Application
;
@Service
public
class
ApplicationRegistry
{
private
final
List
<
Application
>
registry
=
new
ArrayList
<>();
public
void
register
(
Application
app
)
{
Validate
.
notNull
(
app
,
"Application must not be null"
);
Validate
.
notNull
(
app
.
getId
(),
"Application ID must not be null"
);
Validate
.
notNull
(
app
.
getUrl
(),
"Application URL must not be null"
);
registry
.
add
(
app
);
}
public
List
<
Application
>
getApplications
()
{
return
Collections
.
unmodifiableList
(
registry
);
}
}
src/main/resources/application.properties
0 → 100644
View file @
93141a7b
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