AKA: A simple Spring Boot service with an exposed end-point allowing execution of arbitrary Groovy scripts. Groovy scripts are executed within their own cached (and isolated) ClassLoader.
An excuse to play around with Spring Boot and do a very quick comparison of it to common Dropwizard capabilities.
- Overriding ObjectMapper (ie. enable custom serialization features)
- URL Generation (ie. UriComponentsBuilder)
- Configuration Validation (ie. JSR-303)
- Authentication (ie. Spring Security Basic Auth)
- Task Scheduling
[ajordens@Phaeton]$ gradle wrapper
[ajordens@Phaeton]$ ./gradlew bootRun
[ajordens@Phaeton]$ curl http://localhost:8080/api/v1/dynamic
{
"results" : [ {
"name" : "TestScript",
"lastUpdated" : "2014-08-18T05:39:48.000+0000",
"actions" : {
"execute" : "http://localhost:8080/api/v1/dynamic/TestScript"
}
} ]
}
[ajordens@Phaeton]$ curl -u user:password http://localhost:8080/api/v1/dynamic/TestScript
{
"results" : {
"output" : "TestScript executed!",
"hashCode" : 1286548743
}
}