com.englishtown.vertx:vertx-hk2

Provides a VerticleFactory that uses HK2 for dependency injection.

License

License

Categories

Categories

HK2 Application Layer Libs Dependency Injection
GroupId

GroupId

com.englishtown.vertx
ArtifactId

ArtifactId

vertx-hk2
Last Version

Last Version

2.5.0
Release Date

Release Date

Type

Type

jar
Description

Description

Provides a VerticleFactory that uses HK2 for dependency injection.
Project URL

Project URL

https://github.com/englishtown/vertx-hk2
Project Organization

Project Organization

Englishtown

Download vertx-hk2

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.glassfish.hk2 : hk2-api jar 2.5.0-b32
org.glassfish.hk2 : hk2-locator jar 2.5.0-b32
io.vertx : vertx-core jar 3.4.2

test (3)

Group / Artifact Type Version
org.mockito : mockito-core jar 1.10.19
junit : junit jar 4.12
io.vertx : vertx-core test-jar 3.4.2

Project Modules

There are no modules declared in this project.

Vert.x HK2 Extension

Enable Verticle dependency injection using HK2. Deploy your verticle with the java-hk2: prefix to use the HK2VerticleFactory.

Build Status Maven Central

License

http://englishtown.mit-license.org/

Configuration

The vertx-mod-hk2 module configuration is as follows:

{
    "hk2_binder": <hk2_binder>
}
  • hk2_binder - The name of the HK2 binder class which contains the injection configuration. Default is "com.englishtown.vertx.hk2.BootstrapBinder". You can also provide an array of binder classes.

Example

package com.englishtown.vertx.hk2;

import com.englishtown.configuration.ConfigValueManager;
import com.englishtown.configuration.OtherBinder1;
import com.englishtown.configuration.OtherBinder2;
import com.englishtown.configuration.impl.PropertiesConfigValueManager;
import org.glassfish.hk2.utilities.binding.AbstractBinder;

import javax.inject.Singleton;

public class BootstrapBinder extends AbstractBinder {

    @Override
    protected void configure() {

        // Configure bindings
        bind(PropertiesConfigValueManager.class).to(ConfigValueManager.class).in(Singleton.class);

        // Install other binders
        install(new OtherBinder1(), new OtherBinder2());

    }

}
com.englishtown.vertx

Labs @ EF Education First

Repositories moving to https://github.com/ef-labs

Versions

Version
2.5.0
2.4.0
2.3.0
2.2.0
2.1.0
2.0.1
2.0.0
2.0.0-RC5
2.0.0-RC4
2.0.0-RC3
2.0.0-RC2
2.0.0-RC1