Skip to content

Latest commit

 

History

History

spring-context

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Holon platform examples: Spring context resources

This is one of the Holon Platform example projects.

This example shows how to setup a Holon Platform Context scope using Spring application context 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.

Topics

This example addresses the following topics:

  • Use the @EnableBeanContext annotation to setup 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 Main class contains the code to setup the Spring context and use the Context API to obtain the ExampleResource context resource.

Run this example

Run the Main Java 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.