Skip to content

Latest commit

 

History

History

spring-boot-context

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Holon platform examples: Spring Boot context resources

This is one of the Holon Platform example projects.

This example shows how to setup a Holon Platform Context scope, using Spring Boot auot-configuration, to provide context resource instances as Spring beans. This way, any valid Spring bean can be obtained as a context resource using the Holon Platform standard Context API, for example through the static Context.get().resource(Class<T> resourceType) method.

The holon-starter Spring Boot starter is used.

Topics

This example addresses the following topics:

  • Use the Holon Platform core Spring Boot support to auto-configure the Spring beans Context scope
  • Use the Context API to obtain context resources

Example structure

The ExampleResource interface represents the example class to be made available as a Context resource.

The Application class is the Spring Boot starter class and shows how to use the Context API to obtain the ExampleResource context resource.

Run this example

Run the Application class. The following output is expected:

Message: Example resource
Message: Example resource
Message: Thread resource

Documentation

The complete Holon Platform reference guide is available here.

For the specific documentation about the components used in this example see:

System requirements

The Holon Platform is built using Java 8, so you need a JRE/JDK version 8 or above to build and run this example projects.

License

All the Holon Platform modules and examples are Open Source software released under the Apache 2.0 license.

Holon Platform Examples

See Holon Platform Examples for the examples directory.