Hura Web

Hura is a dependency injection framework focused on sequential injection and bean lifecycle management.

License

License

Categories

Categories

Ant Build Tools
GroupId

GroupId

com.mantledillusion.injection
ArtifactId

ArtifactId

hura-web
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Hura Web
Hura is a dependency injection framework focused on sequential injection and bean lifecycle management.

Download hura-web

How to add to project

<!-- https://jarcasting.com/artifacts/com.mantledillusion.injection/hura-web/ -->
<dependency>
    <groupId>com.mantledillusion.injection</groupId>
    <artifactId>hura-web</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.mantledillusion.injection/hura-web/
implementation 'com.mantledillusion.injection:hura-web:2.0.0'
// https://jarcasting.com/artifacts/com.mantledillusion.injection/hura-web/
implementation ("com.mantledillusion.injection:hura-web:2.0.0")
'com.mantledillusion.injection:hura-web:jar:2.0.0'
<dependency org="com.mantledillusion.injection" name="hura-web" rev="2.0.0">
  <artifact name="hura-web" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.mantledillusion.injection', module='hura-web', version='2.0.0')
)
libraryDependencies += "com.mantledillusion.injection" % "hura-web" % "2.0.0"
[com.mantledillusion.injection/hura-web "2.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.mantledillusion.injection : hura-core jar 2.0.0

provided (1)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 4.0.1

Project Modules

There are no modules declared in this project.

Hura

Hura is a dependency injection framework focused on sequential injection and bean lifecycle management.

Hura Crepitans, also called 'Sandbox Tree' and nicknamed 'Dynamite Tree', is a plant mainly living in South America. Its fruits are pumpkin-shaped capsules that undergo huge amounts of tension when drying out during dry season. On the first rain, when the surface of the fruit gets wet and softens up, the dry seeds inside break through the shell with a loud bang, being sling-shotted over a distance for more than 300 feet.

Advantages

As mentioned above, Hura as an injection framework specializes on a couple of advanced aspects of dependency injection:

Automatic Scoping using Injection Sequences

Hura defines a set of referencing beans as a scope and the single injection injecting that set as an injection sequence.

Using an instance of the class Injector injected into any bean of a sequence's scope, Hura allows triggering child injection sequences programatically, which automatically will be recognized as sub-sequences to the parent sequence that injected the Injector and therefor defining a sub-scope of beans.

By trigging further injections from sub-sequences, the scopes will form the so called injection tree, with the allowed depth of the tree being unlimited. Inside the injection tree, beans of any scope have access to all beans of their parent scope (upstream) and naturally will have access to beans of all child scopes (downstream), but will not have any access to beans of scopes in different branches of the tree.

While not effecting basic one-scope injections like application level singleton meshes, this visibility principle is extremely versatile for injecting any type of structure that requires on the fly injection/destruction with bean pool separation like stateful request handling, MVP view assembly or contexted testing.

Bean Lifecycle Management

In addition to plainly allowing code execution on a bean after injecting its scope has been injected, Hura also provides:

  • Executing code before a bean's class is even instantiated
  • Executing code after a bean has been instantiated and injected
  • Executing code after a bean's scope has been injected completely
  • Executing code before a bean's scope is destroyed
  • Executing code after the bean's scope is destroyed

Hura allows hooking to any of these lifecycle milestones by:

  • Hura Annotations on a bean's methods, either on the bean's direct class, its super class or any of its implemented interfaces
  • Hura Annotations on a bean's class referencing an external processor, either on the bean's direct class, its super class or any of its implemented interfaces
  • Hura Annotations on custom method annotations referencing an external processor, with the custom annotation then used on the bean's direct class, its super class, any of its implemented interfaces
  • Hura Annotations on custom class annotations referencing an external processor, with the custom annotation then used on the bean's direct class, its super class, any of its implemented interfaces
  • Independent processor registrations for a specific bean type broadly defined for the injection sequence

Leightweight

Hura has barely any dependencies to other frameworks or libraries, keeping it extremely lightweight.

Transparency

Instead of autonomously doing a whole bunch of intransparent magic trying to desperately interpret any possible use case the developer might have, Hura only executes what is explicitly expressed.

Developer convenience in Hura is not archived by performing brute-force style what-if checks under the hood, but by a simple, intuitive and supportive Java API that requires the littlest configuration for standard use.

This also favors all non-standard scenarios, as the developer can expect complex cases to be handled in the exact same place of the API with only a few more expressions, instead of trying to fumble around with loose configurations in order to get the under the hood magic to behave differently.

Packages

Hura Core

Contains the generic core of the injection framework and most of its functionality around injection, property resolving and bean life cycle handling.

See the documentation for more details.

Hura Web

Combines Hura Core with Java's Servlet API 4 for building deployable web application WARs.

See the documentation for more details.

Hura WebLaunch

Combines Hura Web with an Undertow embedded web server for building runnable lightweight web application JARs.

See the documentation for more details.

Versions

Version
2.0.0
2.0.0.BETA1
2.0.0.ALPHA10
2.0.0.ALPHA9
2.0.0.ALPHA8
2.0.0.ALPHA7
2.0.0.ALPHA6
2.0.0.ALPHA5
2.0.0.ALPHA4
2.0.0.ALPHA3
2.0.0.ALPHA2
2.0.0.ALPHA1