Skip to content

Commit

Permalink
finishing the example
Browse files Browse the repository at this point in the history
  • Loading branch information
trentjeff committed May 11, 2023
1 parent 0cfd9ee commit 0c106bf
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion examples/pico/application/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example shows how a multi-module application can be created using Helidon P

* multi-module usage (i.e., this example extends [basics](../basics), [providers](../providers), and [configdriven](../configdriven) ).
* compile-time generation for the entire multi-module project using the _pico-maven-plugin_ (see [pom.xml](./pom.xml)).
* TestingSupport
* TestingSupport in [ApplicationTest](src/test/java/io/helidon/examples/pico/application/PicoApplicationTest.java)

## Build and run

Expand All @@ -16,4 +16,31 @@ java -jar target/helidon-examples-pico-application.jar

Expected Output:
```
Startup service providers (ranked according to weight, pre-activated): [ToolBox:INIT, CircularSaw:INIT, NailGun:INIT, TableSaw:INIT]
Highest weighted service provider: ToolBox:INIT
-----
Preferred Big Tool: Big Hammer
Optional Little Hammer: Optional[Little Hammer]
-----
ToolBox Contents:
Hammer:INIT
BigHammer:ACTIVE
LittleHammer:ACTIVE
Drill{root}:PENDING
AngleGrinderSaw:INIT
CircularSaw:INIT
HandSaw:INIT
NailGun:INIT
TableSaw:INIT
-----
Highest weighted service provider (after activation): ToolBox
-----
io.helidon.examples.pico.providers.CircularSaw::<init> will be injected with Optional.empty
Circular Saw: (blade=null); initialized
Nail Gun: (nail provider=NailProvider:INIT); initialized
io.helidon.examples.pico.providers.TableSaw::<init> will be injected with Optional[LARGE Blade]
Table Saw: (blade=LARGE Blade); initialized
All service providers (after all activations): [ToolBox:ACTIVE, CircularSaw:ACTIVE, NailGun:ACTIVE, TableSaw:ACTIVE]
```

While the output of this provider may look similar to the one from the previous [providers](../providers) example, the implementation is different. This module builds [Application.java](target/generated-sources/annotations/io/helidon/examples/pico/application/Pico$$Application.java) at compile-time - establishing direct binding to every injection point in your application that is not dynamic in nature (i.e., config-driven services and _Provider_ types).

0 comments on commit 0c106bf

Please sign in to comment.